/* ============ AI创作系统 全局样式 ============ */
:root {
    --primary: #6c5ce7;
    --primary-2: #00cec9;
    --bg: #0f1020;
    --panel: #1a1b33;
    --panel-2: #232545;
    --border: #2e3055;
    --text: #eef0ff;
    --muted: #9aa0c8;
    --ok: #00b894;
    --warn: #fdcb6e;
    --danger: #ff7675;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3a3d6b; border-radius: 4px; }

/* ---- 登录注册 ---- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 20% -10%, #2d2b6b 0%, transparent 60%),
                radial-gradient(900px 500px at 110% 110%, #0d5c63 0%, transparent 55%),
                var(--bg);
    padding: 20px;
}
.auth-card {
    width: 400px; max-width: 100%; background: rgba(26,27,51,.9);
    border: 1px solid var(--border); border-radius: 16px; padding: 34px 30px;
    box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.auth-logo { font-size: 22px; font-weight: 800; text-align: center;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-slogan { color: var(--muted); text-align: center; margin: 8px 0 22px; font-size: 13px; }
.auth-tabs { display: flex; background: var(--panel-2); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted);
    padding: 9px; border-radius: 8px; font-size: 14px; }
.auth-tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ---- 表单 ---- */
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.input, select.input, textarea.input {
    width: 100%; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 11px 13px; color: var(--text); font-size: 14px; outline: none;
    transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.7; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 9px; padding: 10px 18px; font-size: 14px; font-weight: 600;
    background: var(--panel-2); color: var(--text); transition: transform .05s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, var(--primary), #8e7bff); color: #fff; }
.btn-ghost { border: 1px solid var(--border); background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { background: rgba(255,118,117,.14); color: var(--danger); }
.btn-ok { background: rgba(0,184,148,.16); color: var(--ok); }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* ---- 主布局 ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: var(--panel); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.side-logo { padding: 20px 18px 16px; font-weight: 800; font-size: 17px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.side-group { color: #6f74a0; font-size: 11.5px; padding: 14px 10px 6px; letter-spacing: 1px; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
    color: var(--muted); margin-bottom: 2px; cursor: pointer; font-size: 13.5px; }
.side-item:hover { background: var(--panel-2); color: var(--text); }
.side-item.active { background: var(--primary); color: #fff; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.side-foot .user-name { color: var(--text); font-weight: 600; margin-bottom: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; border-bottom: 1px solid var(--border); background: rgba(15,16,32,.8);
    backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.content { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---- 徽标 / 提示 ---- */
.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.badge-demo { background: rgba(253,203,110,.16); color: var(--warn); }
.badge-real { background: rgba(0,184,148,.16); color: var(--ok); }
.badge-proc { background: rgba(108,92,231,.2); color: #a99cff; }
.badge-fail { background: rgba(255,118,117,.16); color: var(--danger); }
.notice { background: rgba(253,203,110,.1); border: 1px solid rgba(253,203,110,.35);
    color: #ffe1a0; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.notice a { color: #fff; text-decoration: underline; }

/* ---- 卡片网格 ---- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 14.5px; margin-bottom: 12px; }
.stat-num { font-size: 26px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* ---- 创作区 ---- */
.create-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.create-tabs button { background: var(--panel); border: 1px solid var(--border); color: var(--muted);
    padding: 9px 18px; border-radius: 99px; font-size: 13.5px; }
.create-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.result-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px; margin-top: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.8; }
.result-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.result-img { width: 100%; border-radius: 10px; display: block; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 作品库 ---- */
.work-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.work-item { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; display: flex; flex-direction: column; }
.work-thumb { aspect-ratio: 4/3; background: var(--panel-2) center/cover no-repeat; display: flex;
    align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 10px;
    text-align: center; overflow: hidden; }
.work-thumb.text-mode { align-items: flex-start; white-space: pre-wrap; font-size: 12px; text-align: left; }
.work-body { padding: 10px 12px; font-size: 12.5px; }
.work-title { font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta { color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }

/* ---- 项目工坊 ---- */
.steps { display: flex; gap: 0; margin-bottom: 22px; }
.step { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 13px; padding-top: 22px; }
.step::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 14px; height: 14px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--border); }
.step::after { content: ''; position: absolute; top: 12px; left: calc(-50% + 20px); right: calc(50% + 20px);
    height: 2px; background: var(--border); }
.step:first-child::after { display: none; }
.step.done { color: var(--ok); }
.step.done::before { background: var(--ok); border-color: var(--ok); }
.step.done::after { background: var(--ok); }
.step.active { color: var(--text); font-weight: 700; }
.step.active::before { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,92,231,.3); }
.shot-card { background: var(--panel-2); border-radius: 10px; overflow: hidden; }
.shot-img { aspect-ratio: 3/4; background: #12132a center/cover no-repeat; display: flex;
    align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.shot-body { padding: 10px 12px; font-size: 12.5px; }
.proj-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }

/* ---- 表格 ---- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.toast {
    position: fixed; left: 50%; top: 26px; transform: translateX(-50%); z-index: 999;
    background: #2d3057; border: 1px solid var(--border); padding: 11px 20px; border-radius: 10px;
    box-shadow: var(--shadow); font-size: 13.5px; opacity: 0; transition: opacity .2s, top .2s; pointer-events: none;
}
.toast.show { opacity: 1; top: 38px; }
.toast.err { background: #5c2733; border-color: #8e3b4b; }
audio { width: 100%; margin-top: 10px; }

@media (max-width: 900px) {
    .sidebar { width: 64px; }
    .side-logo span, .side-item span, .side-group, .side-foot { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
