* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Meiryo, sans-serif;
    background: linear-gradient(120deg, #fdf7f0 0%, #eef3f9 100%);
    min-height: 100vh;
    padding: 20px;
}

.site-header {
    margin: -20px -20px 20px;
    padding: 12px 24px;
    background: #2f4f60;
    display: flex;
    justify-content: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.site-header__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "Noto Sans JP", sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

.site-header__logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #fffdf7;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(47, 79, 96, 0.15);
    padding: 40px;
}

h1 {
    text-align: center;
    color: #2f4f60;
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #6b7078;
    margin-bottom: 30px;
    font-size: 14px;
}

.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2f4f60;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d78e3f;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: bold;
    color: #4a4f55;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #d9cec0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: 'Courier New', monospace;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2f4f60;
}

.variable-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variable-item {
    background: #f5efe4;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #d78e3f;
}

.variable-header {
    font-size: 16px;
    font-weight: bold;
    color: #2f4f60;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.variable-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.variable-controls.list-variable-controls {
    grid-template-columns: 1fr;
}

.control-item {
    display: flex;
    flex-direction: column;
}

.control-item.full-width {
    grid-column: 1 / -1;
}

.control-item label {
    font-size: 12px;
    margin-bottom: 4px;
    color: #5a5f64;
}

.control-item input {
    padding: 8px;
    border: 1px solid #d9cec0;
    border-radius: 6px;
    font-size: 14px;
}

.add-variable-btn {
    background: #8fbf9f;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.add-variable-btn:hover {
    background: #78a989;
}

.remove-variable-btn {
    background: #d6635c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.remove-variable-btn:hover {
    background: #c5554f;
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #d78e3f 0%, #f3c969 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(215, 142, 63, 0.35);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(215, 142, 63, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.result-section {
    margin-top: 30px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-count {
    color: #5a5f64;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: #2f4f60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #253d4a;
}

.action-btn.copy {
    background: #8fbf9f;
}

.action-btn.copy:hover {
    background: #78a989;
}

.example {
    background: #f4efe4;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #2f4f60;
    border-left: 4px solid #d78e3f;
}

.example strong {
    display: block;
    margin-bottom: 8px;
}

.example code {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.example.pattern-guide {
    background: transparent;
    border-left: none;
    padding: 0;
    color: inherit;
}

.pattern-guide .guide-section {
    border: 1px solid #ecd8b8;
    border-radius: 10px;
    background: #fbf5eb;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(47, 79, 96, 0.1);
}

.pattern-guide summary {
    list-style: none;
}

.pattern-guide summary::-webkit-details-marker {
    display: none;
}

.pattern-guide .guide-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    background: linear-gradient(90deg, #2f4f60, #3e6374);
    cursor: pointer;
}

.pattern-guide .guide-section > summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pattern-guide .guide-section > summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 600;
}

.pattern-guide .guide-section[open] > summary::after {
    content: '−';
}

.pattern-guide .guide-body {
    padding: 20px;
    display: grid;
    gap: 16px;
}

.pattern-guide .guide-panel {
    border: 1px solid #e4d4bf;
    border-radius: 8px;
    background: #fffdf7;
}

.pattern-guide .guide-panel > summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #2f4f60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.pattern-guide .guide-panel > summary::after {
    content: '+';
    font-size: 16px;
    font-weight: 600;
    color: #d78e3f;
}

.pattern-guide .guide-panel[open] > summary {
    border-bottom: 1px solid #e4d4bf;
}

.pattern-guide .guide-panel[open] > summary::after {
    content: '−';
}

.pattern-guide .guide-panel-content {
    padding: 14px 16px 18px;
    display: grid;
    gap: 12px;
    font-size: 13px;
    color: #2f4f60;
    line-height: 1.6;
}

.pattern-guide .guide-lead {
    margin: 0;
    font-weight: 500;
}

.pattern-guide .guide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pattern-guide .guide-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4efe4;
    border: 1px solid #e4d4bf;
    font-size: 12px;
    color: #2f4f60;
    font-weight: 500;
}

.pattern-guide .guide-note {
    margin: 0;
    font-size: 12px;
    color: #5a5f64;
}

.pattern-guide .guide-table {
    display: grid;
    gap: 8px;
}

.pattern-guide .guide-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    background: #fff5e8;
    border-radius: 6px;
    border: 1px solid #f0d9b7;
}

.pattern-guide .guide-row code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #d78e3f;
    font-size: 13px;
}

.pattern-guide .guide-steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 4px;
    color: #2f4f60;
}

.pattern-guide .guide-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.pattern-guide .guide-list li {
    color: #2f4f60;
}

@media (max-width: 600px) {
    .pattern-guide .guide-body {
        padding: 16px;
    }

    .pattern-guide .guide-row {
        grid-template-columns: 1fr;
    }

    .pattern-guide .guide-panel > summary {
        font-size: 13px;
    }

    .pattern-guide .guide-section > summary {
        padding: 14px 16px;
        font-size: 14px;
    }
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #8fbf9f;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.show {
    display: block;
}

.variable-list textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px;
    border: 1px solid #d9cec0;
    border-radius: 6px;
    resize: vertical;
    line-height: 1.5;
}

.variable-list textarea:focus {
    outline: none;
    border-color: #2f4f60;
}

textarea {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

#result {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #d9cec0;
    border-radius: 8px;
    resize: vertical;
    line-height: 1.5;
}

#result:focus {
    outline: none;
    border-color: #2f4f60;
}

.pattern-guide .guide-row--list {
    align-items: center;
}

.pattern-guide .guide-row-label {
    font-weight: 600;
    color: #2f4f60;
}
