/* StarkIdea — 灵感库主题 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0b0d1a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #eef0ff;
    --text2: #9aa1c6;
    --accent: #8b7cf8;
    --accent-light: #a99dfa;
    --accent-2: #4ec9f2;
    --grad: linear-gradient(135deg, #8b7cf8 0%, #6d9cf8 55%, #4ec9f2 100%);
    --grad-soft: linear-gradient(135deg, rgba(139,124,248,.16), rgba(78,201,242,.12));
    --star: #f5b63f;
    --danger: #f87171;
    --ok: #4ade80;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

html { scrollbar-color: var(--border-strong) var(--bg); }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
    background:
        radial-gradient(1100px 520px at 82% -12%, rgba(139, 124, 248, 0.16), transparent 62%),
        radial-gradient(900px 460px at -12% 26%, rgba(78, 201, 242, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

::selection { background: rgba(139, 124, 248, 0.35); }
a { color: var(--accent-light); }
input, textarea, select, button { font-family: inherit; }

/* ============ Navbar ============ */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 26, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1120px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo { border-radius: 8px; box-shadow: 0 2px 10px rgba(139, 124, 248, 0.35); }
.nav-title {
    font-size: 1.2rem; font-weight: 800; letter-spacing: .5px;
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
    color: var(--text2); text-decoration: none; font-size: .92rem;
    padding: 7px 12px; border-radius: 999px; transition: all .18s;
}
.nav-link:hover { color: var(--text); background: var(--surface-strong); }
.nav-link.active { color: var(--text); background: var(--grad-soft); outline: 1px solid var(--border); }
.nav-user {
    font-size: .82rem; color: var(--text2); padding: 5px 12px;
    border: 1px dashed var(--border-strong); border-radius: 999px;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--text2); cursor: pointer; transition: all .18s;
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ============ Layout ============ */
.main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }

/* ============ Hero & stats ============ */
.hero { padding: 18px 0 22px; }
.hero h1 {
    font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: .5px;
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text2); margin-top: 6px; font-size: .95rem; max-width: 560px; }

.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: .85rem; color: var(--text2);
}
.chip b { color: var(--text); font-size: .95rem; font-weight: 700; }
.chip i { font-style: normal; }
.chip-star b { color: var(--star); }

/* ============ Filter bar ============ */
.filter-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; margin-bottom: 22px;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1;
}
.search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.search-wrap .search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text2); display: flex; pointer-events: none;
}
.search-wrap input {
    width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text); font-size: .92rem; outline: none; transition: all .18s;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,248,.18); }
.search-wrap input::placeholder { color: var(--text2); opacity: .75; }

.f-select {
    padding: 10px 32px 10px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-strong); color: var(--text);
    font-size: .88rem; cursor: pointer; outline: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239aa1c6' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.f-select:focus { border-color: var(--accent); }

.chip-check {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    padding: 10px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text2); font-size: .88rem; user-select: none; transition: all .18s;
}
.chip-check input { display: none; }
.chip-check:hover { border-color: var(--star); }
.chip-check.checked { border-color: var(--star); color: var(--star); background: rgba(245,182,63,.10); }

.btn-ghost {
    padding: 9px 14px; border-radius: 999px; border: 1px solid transparent;
    background: transparent; color: var(--text2); font-size: .85rem;
    cursor: pointer; text-decoration: none; transition: all .18s; display: inline-flex; align-items: center; gap: 5px;
}
.btn-ghost:hover { color: var(--danger); border-color: var(--danger); }

.filter-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.filter-meta { width: 100%; font-size: .82rem; color: var(--text2); padding: 2px 6px 0; }

/* ============ Buttons ============ */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 22px; border-radius: 999px; border: none;
    background: var(--grad); color: #fff; font-size: .93rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all .2s;
    box-shadow: 0 6px 18px rgba(109, 156, 248, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-soft {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface-strong); color: var(--text); font-size: .9rem;
    cursor: pointer; text-decoration: none; transition: all .18s;
}
.btn-soft:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-soft:disabled { opacity: .55; cursor: not-allowed; }

.btn-danger-soft {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
    background: transparent; color: var(--danger); font-size: .9rem;
    cursor: pointer; text-decoration: none; transition: all .18s;
}
.btn-danger-soft:hover { border-color: var(--danger); background: rgba(248,113,113,.08); }
.btn-danger-soft:disabled { opacity: .55; cursor: not-allowed; }

.btn-ai {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 20px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(139,124,248,.2), rgba(78,201,242,.14));
    border: 1px solid rgba(139,124,248,.45); color: var(--accent-light);
    font-size: .88rem; cursor: pointer; transition: all .18s;
}
.btn-ai:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(139,124,248,.25); }
.btn-ai:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn-ai .spinner, .btn-primary .spinner, .btn-soft .spinner {
    display: none; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3); border-top-color: currentColor;
    animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading { pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Idea grid & cards ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.idea-card {
    position: relative;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 18px 14px;
    display: flex; flex-direction: column; gap: 10px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.idea-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.idea-card.starred { border-left: 3px solid var(--star); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.star-chip {
    display: inline-flex; align-items: center; font-size: .78rem; color: var(--star);
    background: rgba(245,182,63,.10); border: 1px solid rgba(245,182,63,.28);
    padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.card-date { font-size: .78rem; color: var(--text2); white-space: nowrap; }

.idea-title { font-size: 1.02rem; font-weight: 700; line-height: 1.4; }
.idea-title a { color: var(--text); text-decoration: none; transition: color .15s; }
.idea-title a:hover { color: var(--accent-light); }

.badge-ai {
    align-self: flex-start;
    font-size: .72rem; font-weight: 600; letter-spacing: .3px;
    color: var(--accent-light);
    background: linear-gradient(135deg, rgba(139,124,248,.18), rgba(78,201,242,.12));
    border: 1px solid rgba(139,124,248,.4);
    padding: 2px 10px; border-radius: 999px;
}

.idea-preview {
    color: var(--text2); font-size: .88rem; line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-word;
}

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    display: inline-block; padding: 3px 11px; border-radius: 999px;
    background: var(--surface-strong); border: 1px solid var(--border);
    color: var(--text2); font-size: .76rem; text-decoration: none; transition: all .15s;
}
.tag:hover { color: var(--accent-light); border-color: var(--accent); }

.card-actions {
    display: flex; align-items: center; gap: 4px;
    border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 2px;
}
.icon-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 999px; border: none;
    background: transparent; color: var(--text2); font-size: .8rem;
    cursor: pointer; transition: all .15s;
}
.icon-btn:hover { background: var(--surface-strong); color: var(--text); }
.icon-btn.star-on { color: var(--star); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(248,113,113,.08); }
.icon-btn .b { font-size: .78rem; }

/* ============ Empty state ============ */
.empty {
    text-align: center; padding: 70px 20px; border-radius: var(--radius);
    border: 1px dashed var(--border-strong); background: var(--surface);
}
.empty-emoji { font-size: 3rem; }
.empty h3 { margin: 14px 0 6px; font-size: 1.15rem; }
.empty p { color: var(--text2); font-size: .9rem; margin-bottom: 18px; }

/* ============ Pagination ============ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 30px 0 10px; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text2);
    font-size: .86rem; text-decoration: none; transition: all .15s;
}
.page-link:hover { border-color: var(--accent); color: var(--accent-light); }
.page-current { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.page-current:hover { color: #fff; filter: brightness(1.08); }
.page-ellipsis { color: var(--text2); padding: 0 4px; }

/* ============ Form / Create page ============ */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { font-size: 1.45rem; font-weight: 800; }
.page-head .sub { color: var(--text2); font-size: .87rem; }

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px;
    box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field > label { display: block; font-size: .87rem; color: var(--text2); margin-bottom: 8px; font-weight: 600; }
.field input[type="text"], .field textarea {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text); font-size: .95rem; outline: none; transition: border-color .18s, box-shadow .18s;
}
.field input[type="text"]:focus, .field textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,248,.16);
}
.field textarea { resize: vertical; min-height: 200px; line-height: 1.7; }
.field textarea::placeholder, .field input::placeholder { color: var(--text2); opacity: .7; }

.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.field-head label { margin-bottom: 0; }
.char-count { font-size: .75rem; color: var(--text2); }

.voice-btn {
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-strong); font-size: 1.1rem;
    transition: all .18s; display: inline-flex; align-items: center; justify-content: center;
}
.voice-btn:hover { border-color: var(--accent); }
.voice-btn.listening {
    border-color: var(--danger); color: var(--danger);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,.35); }
    50% { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
}
.voice-status { font-size: .82rem; color: var(--text2); }

.row-ai { display: flex; gap: 8px; flex-wrap: wrap; }
.row-ai input { flex: 1; min-width: 160px; }
.check-star {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 10px 16px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text2); font-size: .9rem; user-select: none; transition: all .18s;
}
.check-star input { display: none; }
.check-star:hover { border-color: var(--star); }
.check-star.checked { border-color: var(--star); color: var(--star); background: rgba(245,182,63,.10); }

.form-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; align-items: center; }

.raw-toggle {
    margin-top: 4px; border: none; background: none; color: var(--text2);
    font-size: .82rem; cursor: pointer; text-decoration: underline dotted; padding: 2px 0;
}
.raw-toggle:hover { color: var(--accent-light); }
.raw-box {
    margin-top: 10px; padding: 14px 16px; border-radius: var(--radius-sm);
    background: rgba(245,182,63,0.05); border: 1px dashed rgba(245,182,63,.35);
    color: var(--text2); font-size: .88rem; white-space: pre-wrap; line-height: 1.7;
}
.ai-message { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--ok); font-size: .85rem; }

/* ============ Random page ============ */
.random-wrap { max-width: 760px; margin: 0 auto; }
.random-card {
    position: relative; border-radius: 22px; padding: 34px;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--grad) border-box;
    border: 1.5px solid transparent;
    box-shadow: var(--shadow);
}
.random-label { font-size: .8rem; color: var(--text2); letter-spacing: 1px; }
.random-title { font-size: 1.5rem; font-weight: 800; margin: 8px 0 4px; }
.random-content { white-space: pre-wrap; color: var(--text); line-height: 1.9; margin: 18px 0; word-break: break-word; }
.random-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ============ Auth pages ============ */
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-card {
    border-radius: 22px; padding: 34px 30px;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--grad) border-box;
    border: 1.5px solid transparent;
    box-shadow: var(--shadow);
}
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 6px 20px rgba(139,124,248,.4); }
.auth-logo h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: .5px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: .85rem; color: var(--text2); margin-bottom: 7px; font-weight: 600; }
.auth-field input {
    width: 100%; padding: 12px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-strong);
    color: var(--text); font-size: .95rem; outline: none; transition: all .18s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,248,.16); }
.auth-remember { display: flex; align-items: center; gap: 8px; color: var(--text2); font-size: .87rem; margin: 4px 0 18px; cursor: pointer; user-select: none; }
.auth-remember input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.alert-error {
    padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
    background: rgba(248,113,113,.10); border: 1px solid rgba(248,113,113,.35);
    color: var(--danger); font-size: .87rem;
}
.alert-ok {
    padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
    background: rgba(74,222,128,.10); border: 1px solid rgba(74,222,128,.35);
    color: var(--ok); font-size: .87rem;
}
.auth-foot { text-align: center; margin-top: 18px; font-size: .86rem; color: var(--text2); }
.auth-foot a { color: var(--accent-light); }

/* ============ Toast ============ */
.toast-box { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    padding: 10px 20px; border-radius: 999px; font-size: .87rem;
    background: var(--surface-strong); border: 1px solid var(--border-strong);
    color: var(--text); backdrop-filter: blur(10px);
    box-shadow: var(--shadow); animation: toast-in .25s ease-out;
    max-width: 90vw;
}
.toast.ok { border-color: rgba(74,222,128,.5); color: var(--ok); }
.toast.err { border-color: rgba(248,113,113,.5); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Responsive ============ */
@media (max-width: 760px) {
    .main { padding: 18px 12px 70px; }
    .nav-user { display: none; }
    .filter-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
    .grid { grid-template-columns: 1fr; }
    .panel, .auth-card { padding: 20px 16px; }
    .form-actions .btn-primary, .form-actions .btn-soft, .form-actions .btn-danger-soft { flex: 1; }
    .random-card { padding: 24px 18px; }
}