* {
    box-sizing: border-box;
}

:root {
    --primary: #c1440e;
    --primary-soft: #fff5f0;
    --bg-color: #f5f0e8;
    --border: #e2d7c8;
    --text: #2e2e2e;
    --muted: #6b6560;
    --card: #fff;
    --like: #c1440e;
}

body {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text);
}

.inspire-container {
    max-width: 820px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 28px 32px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 8px;
    min-height: 44px;
}

.header-top h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.back-home {
    position: absolute;
    left: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    color: #888;
    text-decoration: none;
    background: #fafafa;
}

.back-home svg {
    width: 20px;
    height: 20px;
}

.header-actions {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
}

.language-select {
    appearance: none;
    -webkit-appearance: none;
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6560' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 6px 28px 6px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.25;
    cursor: pointer;
    min-height: 32px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.language-select:hover {
    border-color: var(--primary);
}

.language-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.1);
}

.subtitle {
    text-align: center;
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    background: #fffdf9;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.quota-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.field {
    margin-bottom: 14px;
}

.field-label,
.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.theme-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.25;
    min-height: 32px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.theme-chip:hover {
    border-color: var(--primary);
}

.theme-chip.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.custom-theme-wrap input,
#countSelect {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.row-fields {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.row-fields > .count-wrap {
    flex: 0 0 120px;
}

.row-fields .btn-primary {
    flex: 1;
    min-height: 40px;
}

.boldness-field {
    margin-bottom: 14px;
}

.boldness-field > .field-label {
    display: block;
    margin-bottom: 8px;
}

.boldness-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.boldness-seg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

.boldness-dot {
    width: 14px;
    height: 14px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e8e0d6;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.boldness-dot:hover {
    background: #d4c4b0;
}

.boldness-dot.active {
    background: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.18);
}

.boldness-hint {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
}

.feed-head-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.scope-select {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    background: #fff;
    color: var(--text);
    max-width: 9.5rem;
}

.feed-meta {
    margin: 0 0 10px;
    min-height: 1.2em;
    font-size: 0.82rem;
    color: var(--muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.btn-primary,
.btn-secondary,
.btn-reply-send {
    border-radius: 8px;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 8px 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    flex: 1;
    min-height: 40px;
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.status-line {
    min-height: 1.2em;
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.status-line.error {
    color: #b42318;
}

.feed-head {
    align-items: center;
}

.sort-tabs {
    display: flex;
    gap: 4px;
}

.sort-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
}

.sort-tab.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    scroll-margin-top: 16px;
}

.idea-card.highlight {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.idea-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--muted);
}

.theme-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
}

button.theme-tag-btn {
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

button.theme-tag-btn:hover {
    border-color: var(--primary);
    background: #fff;
}

.theme-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.88rem;
}

.theme-filter-bar.hidden {
    display: none;
}

.theme-filter-clear {
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.theme-filter-clear:hover {
    background: var(--primary);
    color: #fff;
}

.btn-action[data-role="delete"] {
    color: #a33;
    margin-left: auto;
}

.btn-action[data-role="delete"]:hover {
    background: #f8e8e8;
}

.idea-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 650;
}

.idea-body {
    margin: 0 0 12px;
    line-height: 1.55;
    color: #3a3a3a;
    white-space: pre-wrap;
}

.idea-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-action:hover {
    background: #f7f4ef;
    color: var(--text);
}

.btn-action svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-action .action-label {
    font-size: 0.82rem;
}

.btn-action .count:empty {
    display: none;
}

.btn-action.liked {
    color: var(--like);
    background: var(--primary-soft);
}

.btn-action.liked svg {
    fill: var(--like);
    stroke: var(--like);
}

.idea-card.example {
    opacity: 0.92;
    border-style: dashed;
}

.example-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eee;
    color: var(--muted);
    font-size: 0.72rem;
}

.idea-card.skeleton {
    pointer-events: none;
    min-height: 110px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%);
    background-size: 200% 100%;
    animation: inspire-shimmer 1.2s ease-in-out infinite;
    margin-bottom: 10px;
}

.skeleton-line.title {
    width: 55%;
    height: 16px;
}

.skeleton-line.body {
    width: 92%;
}

.skeleton-line.short {
    width: 40%;
}

@keyframes inspire-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.replies-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.reply-item {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.reply-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.reply-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reply-form input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-reply-send {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    white-space: nowrap;
}

.feed-footer {
    margin-top: 14px;
    text-align: center;
}

.feed-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

.page-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: rgba(40, 36, 32, 0.92);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    max-width: 90vw;
}

/* Site auth (site-auth.js → #siteAccountRoot) */
.site-account { display: inline-flex; align-items: center; }
.site-auth-header-btn {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 6px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    max-width: 9.5rem;
    min-height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.25;
    transition: border-color 0.15s ease;
}
.site-auth-header-btn:hover { border-color: var(--primary); }
.site-account-logged { position: relative; }
.site-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 11rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    z-index: 10;
}
.site-account-dropdown-open { display: block; }
.site-account-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
}
.site-account-menu-item:hover { background: rgba(193, 68, 14, 0.08); }
.site-auth-dialog {
    position: fixed;
    inset: 0;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: min(90vh, calc(100vh - 32px));
    height: fit-content;
    margin: auto;
    border: none;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: auto;
}
.site-auth-dialog::backdrop { background: rgba(26, 26, 26, 0.45); }
.site-auth-dialog-inner { padding: 22px 22px 20px; }
.site-auth-dialog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text);
}
.site-auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.site-auth-tab {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f7f4ef;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
}
.site-auth-tab-active {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
    font-weight: 600;
}
.site-auth-field { margin-bottom: 12px; }
.site-auth-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.site-auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
    font-family: inherit;
}
.site-auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.1);
}
.site-auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.site-auth-btn-primary {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}
.site-auth-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }
.site-auth-btn-secondary {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}
.site-auth-status { margin-top: 12px; font-size: 0.88rem; min-height: 1.25em; }
.site-auth-status-error { color: #b42318; }
.site-auth-status-success { color: #027a48; }

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    .inspire-container {
        padding: 18px 14px;
    }

    .header-top h1 {
        font-size: 1.25rem;
        max-width: 42%;
    }

    .row-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .row-fields > .count-wrap {
        flex: none;
        width: 100%;
    }

    .row-fields .btn-primary {
        width: 100%;
    }

    .feed-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feed-head-controls {
        width: 100%;
        justify-content: space-between;
    }
}
