/* ============================================================
   Dawnsight Design System (ds.css)
   全站统一设计系统：PC / 手机浏览器响应式
   色值沿用「晨曦」GitHub 浅色系极简风
   ============================================================ */

:root {
    --bg: #fafaf7;
    --surface: #ffffff;
    --border: #ececec;
    --text: #1f2328;
    --muted: #6e7781;
    --soft: #8b949e;
    --accent: #2c3e50;
    --link: #0969da;
    --hover-bg: #f6f8fa;
    --code-bg: #f6f8fa;
    --orange: #e67e22;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 4px 16px rgba(31, 35, 40, .06);
    --shadow-lg: 0 8px 32px rgba(31, 35, 40, .12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- 布局容器 ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 48px 24px 80px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 48px 24px 80px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 48px 24px 80px; }
.wrap-xwide { max-width: 1200px; margin: 0 auto; padding: 48px 24px 80px; }

/* ---------- 顶部导航 ---------- */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}
.brand { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: 0.5px; }
.brand .dot { color: var(--orange); }
.brand:hover { text-decoration: none; }

.topnav .links { display: flex; align-items: center; }
.topnav .links > a,
.topnav .links > .nav-item {
    color: var(--muted);
    margin-left: 22px;
    font-size: 14px;
}
.topnav .links > a:hover { color: var(--text); text-decoration: none; }
.topnav .links > a.active { color: var(--text); font-weight: 600; }

/* 导航下拉（更多 / 用户菜单） */
.nav-item { position: relative; }
.nav-item > button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-item > button:hover { color: var(--text); }
.nav-item > button .fa-angle-down { font-size: 12px; transition: transform .15s; }
.nav-item.open > button { color: var(--text); }
.nav-item.open > button .fa-angle-down { transform: rotate(180deg); }

.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    min-width: 148px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 300;
}
.nav-menu.open { display: block; }
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    margin-left: 0;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
}
.nav-menu a:hover { background: var(--hover-bg); text-decoration: none; }
.nav-menu a .fa { width: 15px; text-align: center; color: var(--soft); font-size: 13px; }
.nav-menu .divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* 登录态：未登录按钮 / 已登录用户片 */
.nav-login {
    margin-left: 22px;
    padding: 5px 16px !important;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text) !important;
    font-size: 13px;
    transition: all .15s;
}
.nav-login:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff !important;
    text-decoration: none;
}
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 4px 8px 4px 4px !important;
    border-radius: 999px;
    cursor: pointer;
}
.nav-user-btn:hover { background: var(--hover-bg); }
.nav-user-btn img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.nav-user-btn .name {
    font-size: 14px;
    color: var(--text);
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-avatar-mobile img { width: 28px; height: 28px; border-radius: 50%; display: block; }

/* 设备可见性 */
.only-mobile { display: none !important; }

/* ---------- 页脚 ---------- */
.footer {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--soft);
}
.footer a { color: var(--muted); margin: 0 10px; }
.footer a:hover { color: var(--text); text-decoration: none; }
.footer .copy { margin-top: 14px; color: var(--soft); font-size: 12px; }

/* ---------- 页头 ---------- */
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.3px; color: var(--text); }
.page-head p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- 区块（首页模块） ---------- */
.section { margin-top: 56px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}
.section-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.3px; }
.section-more { font-size: 13px; color: var(--soft); white-space: nowrap; }
.section-more:hover { color: var(--link); text-decoration: none; }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 卡片 ---------- */
.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    transition: box-shadow .2s, transform .2s;
}
a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.thumb-wrap { position: relative; background: var(--hover-bg); }
.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.dur-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 5px;
}
.play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    opacity: 0;
    background: rgba(0, 0, 0, .25);
    transition: opacity .2s;
}
a.card:hover .play-badge { opacity: 1; }
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; line-height: 1.5; color: var(--text); }
.card-desc {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta { margin-top: 10px; font-size: 12px; color: var(--soft); display: flex; gap: 12px; align-items: center; }
.card-meta .fa { margin-right: 3px; }

/* 置顶角标 */
.pin {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    background: var(--orange);
    padding: 1px 7px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

/* ---------- 虚线列表（最新文章等） ---------- */
.dlist { list-style: none; padding: 0; margin: 0; }
.dlist-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}
.dlist-item:last-child { border-bottom: none; }
.dlist-item .t {
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dlist-item .t:hover { color: var(--link); text-decoration: none; }
.dlist-item time { font-size: 13px; color: var(--soft); white-space: nowrap; }

/* ---------- 导航站图标墙 ---------- */
.sitecell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    transition: box-shadow .15s, border-color .15s;
}
.sitecell:hover { box-shadow: var(--shadow); border-color: #d8dee4; text-decoration: none; }
.sitecell img { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.sitecell .txt { flex: 1; min-width: 0; }
.sitecell .n { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitecell .d { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 音乐曲目行 ---------- */
.track-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--text);
}
.track-row:hover { background: var(--hover-bg); }
.track-row.playing { background: #fff7ed; }
.track-row img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.track-row .ti { flex: 1; min-width: 0; }
.track-row .tn { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row .ta { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row .td { font-size: 12px; color: var(--soft); }
.track-row .eq { color: var(--orange); width: 18px; text-align: center; }

/* ---------- 知识卡（能力边界） ---------- */
.kcard {
    display: block;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: box-shadow .2s, transform .2s;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.kcard .kt { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.kcard .ks {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mastery { display: inline-flex; gap: 3px; margin-top: 10px; }
.mastery i { width: 14px; height: 4px; border-radius: 2px; background: var(--border); }
.mastery i.on { background: var(--orange); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn:hover { background: var(--hover-bg); text-decoration: none; color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #223140; border-color: #223140; color: #fff; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, .textarea, .select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, .12);
}
.textarea { min-height: 96px; resize: vertical; }
.form-tip { font-size: 12px; color: var(--soft); margin-top: 6px; }
.form-error { font-size: 13px; color: #cf222e; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.checkbox-inline input { accent-color: var(--accent); }

/* ---------- 面板 / 标签 ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.chip {
    display: inline-block;
    padding: 5px 14px;
    margin: 0 8px 8px 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
    transition: all .15s;
}
.chip:hover { border-color: var(--link); color: var(--link); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 头像 / 空态 ---------- */
.avatar { border-radius: 50%; object-fit: cover; }
.empty { padding: 80px 0; text-align: center; color: var(--soft); }
.empty .fa { font-size: 36px; margin-bottom: 12px; opacity: .5; }

/* ---------- 迷你播放器（固定底部） ---------- */
.mini-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    display: none;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(31, 35, 40, .08);
}
.mini-player.show { display: block; }
.mini-player .mp-in {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
}
.mini-player img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.mini-player .mp-info { flex: 1; min-width: 0; }
.mini-player .mp-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player .mp-artist { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player .mp-credit { font-size: 10px; color: var(--soft); opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player .mp-credit:empty { display: none; }
.mini-player .mp-ctrl { display: flex; align-items: center; gap: 4px; }
.mini-player .mp-ctrl button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 17px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mini-player .mp-ctrl button:hover { background: var(--hover-bg); }
.mini-player .mp-ctrl .mp-play { font-size: 20px; }
.mini-player .mp-prog {
    flex: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}
.mini-player .mp-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.mini-player .mp-bar i { display: block; height: 100%; width: 0; background: var(--orange); }
.mini-player .mp-time { font-size: 11px; color: var(--soft); white-space: nowrap; }
.mini-player .mp-close { color: var(--soft); font-size: 14px; }

/* ---------- 视频弹层 ---------- */
.ds-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 18, 22, .72);
    padding: 20px;
}
.ds-modal.show { display: flex; }
.ds-modal-box { width: 100%; max-width: 860px; }
.ds-modal-box video { width: 100%; max-height: 76vh; border-radius: var(--radius); background: #000; display: block; }
.ds-modal-cap { color: #e8eaed; font-size: 14px; margin-top: 12px; text-align: center; }
.ds-modal-x {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    opacity: .8;
}
.ds-modal-x:hover { opacity: 1; }

/* ---------- 工具 ---------- */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.mt-0 { margin-top: 0; }
.text-muted { color: var(--muted); }
.text-soft { color: var(--soft); }

/* ---------- 会员中心布局 ---------- */
.member-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidenav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.snav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14px;
}
.snav-link:last-child { margin-bottom: 0; }
.snav-link:hover { background: var(--hover-bg); color: var(--text); text-decoration: none; }
.snav-link.active { background: var(--accent); color: #fff; }
.snav-link .fa { width: 16px; text-align: center; }
.page-title { font-size: 18px; font-weight: 700; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); letter-spacing: -0.2px; }

/* ---------- 登录/注册 ---------- */
.auth-box { max-width: 420px; margin: 32px auto 0; }
.auth-tab { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.auth-tab a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab a:hover { color: var(--text); text-decoration: none; }
.auth-tab a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--orange); }
.auth-meta { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 18px; }
.auth-meta a { font-size: 13px; color: var(--soft); }
.auth-meta a:hover { color: var(--link); }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--soft); }
.captcha-img { height: 40px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border); }
.input-group-row { display: flex; gap: 10px; align-items: stretch; }
.input-group-row .input { flex: 1; }

/* ---------- 通用弹层（表单用） ---------- */
.ds-modal-panel {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 26px 26px 22px;
    max-height: 86vh;
    overflow-y: auto;
}
.ds-modal-title { font-size: 17px; font-weight: 700; margin: 0 0 18px; }

/* ============================================================
   移动端（≤720px）
   ============================================================ */
@media (max-width: 720px) {
    .wrap, .wrap-narrow, .wrap-wide, .wrap-xwide { padding: 22px 16px 64px; }

    .only-desktop { display: none !important; }
    .only-mobile { display: inline-flex !important; }

    /* 顶导航：品牌一行 + 链接横向滚动 */
    .topnav {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 12px;
        margin-bottom: 28px;
        gap: 8px;
    }
    .brand { padding: 2px 4px; }
    .topnav .links {
        display: flex;
        align-items: center;
        gap: 2px;
        margin: 0 -16px;
        padding: 4px 16px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .topnav .links::-webkit-scrollbar { display: none; }
    .topnav .links > a,
    .topnav .links > .nav-item {
        margin-left: 0;
        padding: 7px 12px;
        flex-shrink: 0;
        font-size: 14px;
        border-radius: 6px;
    }
    .topnav .links > a:active { background: var(--hover-bg); }
    .topnav .links > a.active { background: var(--hover-bg); }
    .nav-login { margin-left: 0 !important; padding: 5px 14px !important; }

    .footer { margin-top: 48px; padding-top: 22px; }
    .footer a { margin: 0 7px; }

    .section { margin-top: 44px; }
    .section-title { font-size: 18px; }

    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }

    .panel { padding: 20px; }

    .mini-player .mp-prog { display: none; }
    .mini-player .mp-in { padding: 8px 12px; gap: 10px; }

    .member-grid { grid-template-columns: 1fr; }
    .sidenav { display: flex; overflow-x: auto; padding: 6px; gap: 2px; scrollbar-width: none; }
    .sidenav::-webkit-scrollbar { display: none; }
    .snav-link { white-space: nowrap; margin-bottom: 0; padding: 7px 12px; flex-shrink: 0; }

    .auth-box { margin-top: 8px; }
}
