/* ===== CSS Variables ===== */
:root {
    /* Manus palette — sampled from manus.im/app screenshot */
    --bg-primary: #f2f1ed;
    --bg-secondary: #e8e7e2;
    --bg-tertiary: #deddd7;
    --bg-card: #faf9f6;
    
    --text-primary: #20201e;
    --text-secondary: #555550;
    --text-muted: #7f7f78;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-success: #22a06b;
    --accent-warning: #d4923a;
    --accent-danger: #e5484d;
    --accent-purple: #7c6af0;
    --ase-cyan: #5eb8c9;
    --ase-blue: #3b82f6;
    --ase-amber: #d4923a;
    --ase-green: #22a06b;
    --ase-gradient: linear-gradient(180deg, #4b8ef7 0%, #3b82f6 100%);
    
    --border-color: rgba(31, 31, 28, 0.1);
    --border-radius: 12px;
    --border-radius-lg: 18px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.06);
    
    --transition: all 0.2s ease;
    
    --sidebar-width: 240px;
    --header-height: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

/* 海外地域由 QuodaraI18n.applyI18n() 给备案信息置上 hidden；
   这些块自己带 display:flex，不 !important 盖不住。 */
[data-region-cn-only][hidden] {
    display: none !important;
}

.site-icp-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px 16px;
    justify-content: center;
    padding: 8px 16px;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.site-icp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
}

.site-icp-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.site-gongan-icon {
    width: auto;
    height: 15px;
    flex-shrink: 0;
}

/* 条款入口：所有地域都要露出，海外 MOR 审核会直接点这个链接 */
.site-policy-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    justify-content: center;
    padding: 8px 16px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

/* 同一排里既有 <a>（独立条款页）也有 <button>（站内切页 / 弹窗），统一按文本链接渲染 */
.site-policy-link {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.site-policy-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.auth-layout .site-icp-footer {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    z-index: 1;
    color: rgba(255, 255, 255, 0.58);
}

.sidebar-footer .site-icp-footer {
    margin-top: 8px;
    padding: 8px 0 0;
    gap: 2px 10px;
    font-size: 11px;
    border-top: 1px solid var(--border-color);
}

.chat-sidebar > .site-icp-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.deploy-page + .site-icp-footer {
    padding-bottom: 24px;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== App Container ===== */
.app-container {
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
}

/* ===== Auth Page ===== */
.auth-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #0d0f0e;
    --ase-bg: #0d0f0e;
    --ase-bg-soft: #151817;
    --ase-panel: #101514;
    --ase-panel-soft: #171d1b;
    --ase-cyan: #2EC8B8;
    --ase-blue: #4D78D8;
    --ase-amber: #C77B2B;
    --ase-green: #738F4A;
    --ase-line: rgba(255, 255, 255, 0.16);
    --ase-grad: var(--ase-gradient);
}

.auth-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.28;
}

/* Left brand panel */
.auth-brand {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(44px, 5vw, 72px) clamp(48px, 6vw, 88px);
    background:
        linear-gradient(90deg, rgba(13, 15, 14, 0.98) 0%, rgba(13, 15, 14, 0.86) 52%, rgba(13, 15, 14, 0.72) 100%),
        linear-gradient(135deg, rgba(46, 200, 184, 0.14) 0%, rgba(77, 120, 216, 0.12) 48%, rgba(199, 123, 43, 0.10) 100%),
        #0d0f0e;
    color: var(--text-primary);
    isolation: isolate;
    border-right: 1px solid rgba(255, 255, 255, 0.10);
}

.auth-brand-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.brand-shape {
    position: absolute;
    opacity: 0.7;
}

.brand-shape-1 {
    width: min(360px, 56vw);
    height: 1px;
    background: var(--ase-grad);
    top: clamp(64px, 8vw, 112px);
    left: clamp(24px, 7vw, 72px);
}

.brand-shape-2 {
    width: 190px;
    height: 190px;
    right: 82px;
    bottom: 88px;
    border: 1px solid rgba(46, 200, 184, 0.22);
    border-radius: 8px;
    transform: rotate(8deg);
}

.brand-shape-3 {
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--ase-cyan) 40%, var(--ase-amber) 100%);
    top: 48%;
    right: 18%;
    transform: rotate(115deg);
}

.brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 86%);
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 86%);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(22px, 3vw, 34px);
}

.brand-logo .logo-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 18px 28px rgba(46, 200, 184, 0.22));
}

.brand-logo-text {
    display: grid;
    gap: 3px;
    line-height: 1;
}

.brand-logo-text strong {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 900;
    background: var(--ase-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-logo-text em {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-kicker {
    margin-bottom: 12px;
    color: var(--ase-cyan);
    font-size: 13px;
    font-weight: 800;
}

.brand-headline {
    max-width: 520px;
    font-size: clamp(34px, 4.2vw, 44px);
    line-height: 1.12;
    font-weight: 900;
    margin-bottom: 18px;
    color: #ffffff;
}

.brand-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.72;
    margin-bottom: clamp(24px, 3vw, 36px);
    max-width: 500px;
}

.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-features li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 15px 16px;
    background: rgba(21, 24, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.brand-features li:hover {
    background: rgba(23, 29, 27, 0.92);
    border-color: rgba(46, 200, 184, 0.36);
    transform: translateX(2px);
}

.brand-feature-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #07110f;
    background: var(--ase-grad);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    flex: none;
    margin-top: 1px;
}

.brand-feature-icon::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 17px;
    width: 12px;
    height: 1px;
    background: rgba(46, 200, 184, 0.48);
}

.brand-features li > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-features li strong {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.brand-features li span:not(.brand-feature-icon) {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.5;
}

/* Right auth panel */
.auth-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    background:
        linear-gradient(180deg, rgba(13, 15, 14, 0.72), rgba(13, 15, 14, 0.98)),
        #0d0f0e;
}

.auth-card {
    position: relative;
    overflow: hidden;
    background: rgba(21, 24, 23, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    padding: 34px;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.46);
    animation: fadeIn 0.4s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--ase-grad);
}

.auth-card-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-card-brand .logo-icon {
    width: 42px;
    height: 42px;
}

.auth-card-brand div {
    display: grid;
    gap: 3px;
}

.auth-card-brand strong {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.auth-card-brand span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    line-height: 1.2;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 8px rgba(46, 200, 184, 0.35));
}

.logo h1 {
    font-size: 26px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.58);
    transition: var(--transition);
    font-weight: 800;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    background: var(--ase-grad);
    color: #07110f;
    box-shadow: 0 14px 30px rgba(46, 200, 184, 0.12);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.auth-form .btn-primary {
    width: 100%;
    min-height: 44px;
    background: var(--ase-grad);
    color: #07110f;
    border: 0;
    border-radius: 8px;
    font-weight: 900;
    box-shadow: 0 18px 34px rgba(46, 200, 184, 0.12);
}

.auth-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(46, 200, 184, 0.18);
}

.wechat-login-panel {
    text-align: center;
}

.wechat-login-hint {
    margin: 0 0 16px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 14px;
    font-weight: 600;
}

.wechat-qrcode-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wechat-qrcode-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wechat-qrcode-placeholder {
    color: #667;
    font-size: 13px;
    padding: 12px;
}

.wechat-login-status {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    min-height: 1.2em;
}

.wechat-qrcode-refresh {
    min-width: 120px;
}

.google-login-panel {
    text-align: center;
}

.google-login-hint {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 14px;
    font-weight: 600;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--ase-grad);
    color: #07110f;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 18px 34px rgba(46, 200, 184, 0.12);
}

.btn-google:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(46, 200, 184, 0.18);
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.btn-google-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.google-login-status {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    min-height: 1.2em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 14px;
    font-weight: 700;
}

.label-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label-with-action label {
    margin-bottom: 0;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(13, 15, 14, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--ase-cyan);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.14);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.34);
}

.form-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* 通用表单控件暗色样式：覆盖 input / select / textarea，与所在弹窗的暗色主题保持一致。
   原本 select 没有暗色规则，会回落到浏览器默认的白底，造成弹窗内观感割裂。 */
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* select 还原下拉箭头（appearance: none 会清掉浏览器原生箭头），并指定下拉项的暗色背景。
   注意 <option> 在不同浏览器（尤其是 Windows Chrome）只能继承部分样式，但至少能避免
   弹窗主体白底刺眼的问题。 */
select.form-input {
    padding-right: 32px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                      linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 16px) center, calc(100% - 11px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

select.form-input option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 表单字段下方的红字提示（用于强调可用性 / 风险类信息）。 */
.form-hint--danger {
    color: var(--accent-danger);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.5;
}

.btn-primary {
    width: auto;
    padding: 12px 24px;
    background: var(--ase-gradient);
    color: #07110f;
    border-radius: var(--border-radius);
    font-weight: 800;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(46, 200, 184, 0.18);
}

.btn-primary:active {
    transform: translateY(0);
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
    display: none;
}

.message.error {
    display: block;
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--accent-danger);
}

.message.success {
    display: block;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: var(--accent-success);
}

/* ===== Main Page Layout ===== */
#main-page {
    display: none;
}

#main-page.active {
    display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(21, 24, 23, 0.96), rgba(13, 15, 14, 0.98)),
        var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* 主侧栏（index.html）比 chat.html 那条侧栏挤得多：导航 + 对话历史 + 底部按钮都在这一列，
   固定占位每多 10px，1366×768 的笔记本上就少看到半条对话历史。所以这里单独收紧，
   chat.html 的 .chat-sidebar .sidebar-header 保持原值。 */
#main-sidebar.sidebar .sidebar-header {
    padding: 12px 14px;
}

.sidebar-header .logo-icon {
    width: 38px;
    height: 38px;
}

.sidebar-header .logo-trademark-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 150px;
    height: 34px;
    overflow: visible;
}

.sidebar-header .logo-trademark {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-header .logo-text {
    min-width: 0;
    max-width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    background: var(--ase-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 0 0 auto;
    padding: 10px 10px 6px;
}

/* ===== Sidebar Recent Chats (ChatGPT-style) ===== */
.sidebar-recent-chats {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 10px 8px;
    border-top: 1px solid var(--border-color);
}

.sidebar-recent-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 2px 4px 6px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-recent-title-text {
    font-weight: 600;
    opacity: 0.85;
}

.sidebar-recent-tab {
    flex: none;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted, var(--text-secondary));
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    cursor: pointer;
    opacity: 0.65;
    transition: var(--transition);
}

.sidebar-recent-tab:hover {
    opacity: 1;
    color: var(--text-primary);
}

.sidebar-recent-tab.active {
    opacity: 1;
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.12);
}

.sidebar-recent-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-recent-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar-recent-item {
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    user-select: none;
}

.sidebar-recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.sidebar-recent-item.active {
    background: rgba(46, 200, 184, 0.14);
    color: var(--accent-primary);
}

.sidebar-recent-row1 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.sidebar-recent-chat-id {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.sidebar-recent-status {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-recent-status.running {
    color: var(--accent-warning);
}

.sidebar-recent-status.completed {
    color: var(--accent-success);
}

.sidebar-recent-status.terminated {
    color: var(--accent-danger);
}

.sidebar-recent-title {
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-recent-star {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent-warning, #d29922);
    opacity: 0.9;
    line-height: 1;
}

.sidebar-recent-empty {
    padding: 12px 10px;
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.7;
    text-align: center;
}

.sidebar-recent-load-more {
    padding: 8px 4px 2px;
}

.sidebar-recent-load-more-btn {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    transition: var(--transition);
}

.sidebar-recent-load-more-btn:hover:not(:disabled) {
    color: var(--accent-primary);
    border-color: rgba(46, 200, 184, 0.4);
}

.sidebar-recent-load-more-btn:disabled {
    cursor: default;
    opacity: 0.65;
}

/* chats-view 主侧栏已承载 Recent 列表，隐藏视图内置的 sc-sidebar 让主区域全宽 */
.chats-split-view .sc-sidebar,
.chats-split-view .sc-sidebar-toggle,
.chats-split-view .sc-sidebar-overlay {
    display: none !important;
}

.chats-split-view .sc-main {
    margin-left: 0;
    width: 100%;
    flex: 1 1 auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    /* 10px 上下内边距 + 24px 图标 = 44px，正好卡在可点击区域的下限上，不要再往下压 */
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(46, 200, 184, 0.13);
    border-color: rgba(46, 200, 184, 0.34);
    color: var(--accent-primary);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
}

/* 底部只剩「个人信息页跳转（昵称）」+「退出」两个按钮，并排一行：
   竖排要多花一整行高度，而这块的高度直接换成上面的对话历史条数 */
.sidebar-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user-panel {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    color: inherit;
}

.sidebar-user-panel-clickable {
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user-panel-clickable:hover {
    background: var(--bg-card);
    border-color: rgba(46, 200, 184, 0.35);
    box-shadow: 0 0 0 1px rgba(46, 200, 184, 0.15);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    background: transparent;
    border-radius: 0;
}

.user-avatar {
    font-size: 18px;
    flex: none;
    line-height: 1;
    /* 设了头像时装的是一张 22px 圆图，没设时还是那个表情字符 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.sidebar-user-avatar-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* 昵称可能很长，截断而不是把退出按钮挤出侧栏 */
.sidebar-user-name {
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(248, 81, 73, 0.15);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* 矮屏（1366×768 这类笔记本）再压一次固定占位：只动 logo / 页头 / 页脚这些"不可点"的留白，
   .nav-item 的 44px 可点击高度保持不变。省下来的高度全部归 .sidebar-recent-list。 */
@media (max-height: 820px) {
    #main-sidebar.sidebar .sidebar-header {
        padding: 8px 14px;
    }

    #main-sidebar .sidebar-header .logo-trademark-wrap {
        width: 128px;
        height: 28px;
    }

    #main-sidebar .sidebar-nav {
        padding: 6px 10px 4px;
    }

    #main-sidebar .sidebar-footer {
        padding: 8px 12px;
    }

    #main-sidebar .sidebar-footer .site-icp-footer {
        margin-top: 6px;
        padding: 6px 0 0;
        font-size: 10px;
    }
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 24px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(180deg, #0d0f0e 0%, #101412 100%);
    background-size: 44px 44px, 44px 44px, auto;
    min-height: 100vh;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

/* List views fill the available main-content width. On wide monitors the
   per-column percentage widths defined further below redistribute the extra
   space proportionally instead of dumping it all into the title/name column. */
#apps-view {
    width: 100%;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.view-header .btn-primary {
    padding: 10px 20px;
}

.view-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tasks-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-filter-group {
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.status-filter-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-btn.checked {
    background: rgba(46, 200, 184, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.filter-btn input[type="checkbox"] {
    display: none;
}

/* Search Input */
.search-input {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    width: 140px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* 按钮样式套在 <a> 上时要补 <button> 的默认盒模型，否则会塌成一行带下划线的文字。
   落地页里几个「看起来是按钮、其实要给爬虫一个 href」的入口走这条。
   刻意不写 font 简写：那会盖掉 .lp-btn-lg / .lp-btn-sm 的 font-size。 */
a.btn-primary,
a.btn-secondary {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

/* Load More Indicator */
.load-more-indicator {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filter checkbox style */
.filter-btn input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--accent-primary);
}

/* ===== Data Table ===== */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(46, 200, 184, 0.055);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.tasks-table {
    table-layout: fixed;
}

/* Title column is the only "auto" column — it absorbs remaining width and
   ellipsis-truncates long titles. All other columns are fixed-width so the
   table degrades gracefully on laptop widths without wrapping action buttons. */
.tasks-table .task-col-id {
    width: 72px;
}

.tasks-table .task-col-title {
    width: auto;
}

.tasks-table .task-col-status {
    width: 130px;
}

.tasks-table .task-col-app {
    width: 150px;
}

.tasks-table .task-col-created {
    width: 168px;
}

.tasks-table .task-col-actions {
    width: 220px;
}

.task-title-cell {
    max-width: 0;
}

.task-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.task-actions-cell {
    white-space: normal;
}

.task-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.task-actions .btn-action {
    margin-right: 0;
    padding: 5px 10px;
    flex: none;
    white-space: nowrap;
}

.apps-table {
    min-width: 960px;
    table-layout: fixed;
}

.apps-table .app-col-id {
    width: 78px;
}

.apps-table .app-col-name {
    width: auto;
}

.apps-table .app-col-status {
    width: 130px;
}

.apps-table .app-col-links {
    width: 140px;
}

.apps-table .app-col-created {
    width: 170px;
}

.apps-table .app-col-actions {
    width: 200px;
}

.apps-card-container {
    background: rgba(21, 24, 23, 0.82);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.apps-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.published-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.apps-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

/* APP 页头部右侧动作区：「已发布应用」入口 + 「新建应用」 */
.apps-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apps-tab-btn {
    padding: 8px 18px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.apps-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.apps-tab-btn.active {
    color: #07110f;
    background: var(--ase-gradient);
}

.apps-board-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.apps-board-panel[hidden],
.apps-card-container[hidden] {
    display: none !important;
}

.apps-board-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apps-board-toolbar-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

/* 顶部应用筛选：整个看板只渲染选中的那一个应用 */
.apps-board-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apps-board-filter[hidden] {
    display: none !important;
}

.apps-board-filter-label {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.apps-board-select {
    min-width: 200px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.apps-board-default-btn {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.apps-board-default-btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

.apps-board-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.apps-board-alert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 0;
    padding: 4px 12px 4px 4px;
    border: 1px solid rgba(229, 72, 77, 0.35);
    border-radius: 999px;
    background: rgba(229, 72, 77, 0.08);
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
}

.apps-board-alert[hidden] {
    display: none !important;
}

.apps-board-alert:hover {
    background: rgba(229, 72, 77, 0.14);
}

.apps-board-alert-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-danger);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

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

.apps-board-card {
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.apps-board-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.apps-board-card-meta {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.apps-board-notice {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.apps-board-notice.is-warn {
    border: 1px solid rgba(229, 72, 77, 0.28);
    background: rgba(229, 72, 77, 0.08);
    color: var(--accent-danger);
}

/* 「采集正常，只是没人来」是陈述不是故障，用中性色——染成红的会让人去修没坏的东西。 */
.apps-board-notice.is-info {
    border: 1px solid var(--border-color);
    background: rgba(127, 127, 120, 0.06);
    color: var(--text-secondary);
}

/* 总览 KPI：一眼看完「多少人来、从哪来、跑得快不快」 */
.apps-board-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.apps-board-kpi {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.apps-board-kpi-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}

.apps-board-kpi-value {
    display: block;
    margin: 4px 0 2px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.apps-board-kpi-sub {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.apps-board-section + .apps-board-section,
.apps-board-grid + .apps-board-section {
    margin-top: 16px;
}

.apps-board-block-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.apps-board-block-head h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.apps-board-subsection h5 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.apps-board-chart-canvas {
    width: 100%;
    height: 240px;
}

.apps-board-empty-line {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 统计口径说明：紧贴标题下方，比数据本身弱一级 */
.apps-board-note {
    margin: 2px 0 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 建议列表：warn 在前，good 收尾，颜色只用左边一条竖线，不抢数据的视觉权重 */
.apps-board-insights {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apps-board-insight {
    padding: 8px 10px 8px 12px;
    border-left: 3px solid var(--border-color);
    border-radius: 0 6px 6px 0;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.6;
}

.apps-board-insight.is-warn {
    border-left-color: var(--accent-danger);
}

.apps-board-insight.is-info {
    border-left-color: var(--accent-primary);
}

.apps-board-insight.is-good {
    border-left-color: var(--accent-success);
}

.apps-board-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.apps-board-table {
    width: 100%;
    font-size: 12px;
}

.apps-board-table .apps-board-cell-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* 接口地址和错误信息都很长，截断 + title 悬浮看全文，别把表撑破 */
.apps-board-cell-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apps-board-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
}

.apps-board-tag.is-search { color: var(--accent-primary); }
.apps-board-tag.is-ai { color: var(--accent-purple); }
.apps-board-tag.is-social { color: var(--accent-warning); }
.apps-board-tag.is-direct { color: var(--text-secondary); }

.apps-board-chart-bar.is-search { background: var(--accent-primary); }
.apps-board-chart-bar.is-ai { background: var(--accent-purple); }
.apps-board-chart-bar.is-social { background: var(--accent-warning); }
.apps-board-chart-bar.is-direct { background: var(--ase-cyan); }
.apps-board-chart-bar.is-other { background: var(--text-muted); }

.apps-board-select-narrow {
    min-width: 120px;
}

.apps-board-app-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.apps-board-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.apps-board-section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 同一个 section 里的二级小标题（来源明细下面的转化明细）。上边距把两张表分开，
   否则它们会读成一张表的续行。 */
.apps-board-subtitle {
    margin: 14px 0 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.apps-board-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
}

.apps-board-loading {
    color: var(--text-secondary);
    font-size: 12px;
}

.apps-board-error {
    margin-top: 6px;
    color: var(--danger-color, #dc3545);
    font-size: 12px;
    word-break: break-word;
}

.apps-board-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.apps-board-chart-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.apps-board-chart-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(46, 200, 184, 0.14);
    overflow: hidden;
}

.apps-board-chart-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--ase-gradient);
}

.apps-board-chart-value {
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.apps-board-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.apps-board-stat {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(46, 200, 184, 0.06);
}

.apps-board-stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}

.apps-board-stat-value {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.apps-board-missing-table-wrap {
    overflow-x: auto;
}

.apps-board-missing-table {
    width: 100%;
}

.apps-board-missing-table th:last-child,
.apps-board-missing-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.apps-board-missing-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.apps-board-fix {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .apps-board-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .apps-board-grid {
        grid-template-columns: 1fr;
    }

    .apps-board-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apps-board-chart-canvas {
        height: 200px;
    }

    .apps-board-cell-name {
        max-width: 160px;
    }

    .apps-board-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .apps-board-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .apps-board-select {
        min-width: 0;
        width: 100%;
    }

    .apps-board-stats {
        grid-template-columns: 1fr;
    }
}

.app-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(46, 200, 184, 0.07), rgba(13, 15, 14, 0)),
        rgba(17, 22, 20, 0.86);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.app-card-clickable {
    cursor: pointer;
}

.app-card:hover {
    border-color: rgba(46, 200, 184, 0.36);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.app-card-preview {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

button.app-card-preview {
    padding: 0;
    text-align: left;
}

.app-card-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    border: 0;
    pointer-events: none;
    transform: scale(0.5);
    transform-origin: top left;
    background: #fff;
}

.app-card-thumbnail-shell,
.app-card-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.app-card-thumbnail-shell {
    background:
        linear-gradient(135deg, rgba(46, 200, 184, 0.13), transparent 42%),
        var(--bg-secondary);
}

.app-card-thumbnail {
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-card-thumbnail-shell.is-thumbnail-loaded .app-card-thumbnail {
    opacity: 1;
}

.app-card-thumbnail-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
    background: rgba(13, 17, 23, 0.58);
    transition: opacity 0.2s ease;
}

.app-card-thumbnail-shell.is-thumbnail-loaded .app-card-thumbnail-state {
    opacity: 0;
}

.app-card-thumbnail-shell.is-thumbnail-failed .app-card-thumbnail-state {
    opacity: 1;
}

/* 加载中 / 加载失败复用同一块遮罩，靠 shell 上的状态类切换文案 */
.app-card-thumbnail-failed-text {
    display: none;
}

.app-card-thumbnail-shell.is-thumbnail-failed .app-card-thumbnail-loading-text {
    display: none;
}

.app-card-thumbnail-shell.is-thumbnail-failed .app-card-thumbnail-failed-text {
    display: block;
    color: var(--accent-warning);
}

.app-card-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
}

.app-card-preview-default-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-secondary);
    background:
        linear-gradient(135deg, rgba(46, 200, 184, 0.13), transparent 42%),
        var(--bg-secondary);
}

.app-card-placeholder-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
}

.app-card-preview-placeholder.is-unavailable .app-card-placeholder-icon {
    background: rgba(210, 153, 34, 0.14);
    color: var(--accent-warning);
}

.app-card-placeholder-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.app-card-placeholder-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.app-card-title {
    min-width: 0;
}

.app-card-meta {
    display: flex;
    align-items: center;
    /* 公开状态 + 公开分类两个徽章并排，窄卡片下允许换行而不是把标题挤变形 */
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.app-card-id {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
}

.app-visibility-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.app-visibility-badge.is-public {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.app-visibility-badge.is-private {
    background: rgba(139, 148, 158, 0.14);
    color: var(--text-secondary);
}

/* 已勾选公开、但还没成功发布生产：用告警色区分，提示公开尚未真正生效 */
.app-visibility-badge.is-pending-public {
    background: rgba(210, 153, 34, 0.16);
    color: var(--accent-warning, #d29922);
}

/* 公开分类（游戏 / 其他）：跟公开状态徽章同形不同色，避免抢状态的视觉权重 */
.app-visibility-badge.is-category {
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
}

.app-card-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-card-field {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.app-card-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.app-card-value {
    min-width: 0;
    color: var(--text-primary);
    font-size: 14px;
}

.app-card-field-link .app-card-value {
    display: flex;
    min-width: 0;
}

.app-prod-link-empty {
    color: var(--text-secondary);
    font-size: 13px;
}

.app-card-actions {
    margin-top: auto;
    padding-top: 2px;
}

.app-card-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    transition: var(--transition);
}

.app-social-btn strong {
    color: var(--text-primary);
    font-weight: 700;
}

.app-social-btn:hover,
.app-social-btn.active {
    border-color: rgba(46, 200, 184, 0.45);
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.12);
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.app-pagination:empty {
    display: none;
}

.app-pagination-summary,
.app-page-info {
    color: var(--text-secondary);
    font-size: 13px;
}

.app-pagination-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-pagination .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.app-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.app-status-badge.status-creating {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

.app-status-badge.status-success {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.app-status-badge.status-failed {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger, #f85149);
}

.app-status-badge.status-starting {
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary, #2EC8B8);
}

.app-status-badge.status-updating {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.app-status-badge.clickable {
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter 150ms ease, border-color 150ms ease;
}

.app-status-badge.clickable:hover {
    filter: brightness(1.1);
    border-color: currentColor;
}

.app-status-badge.clickable:focus-visible {
    outline: none;
    border-color: currentColor;
}

.app-status-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-status-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.app-status-detail-trace {
    font-size: 12px;
    color: var(--text-secondary, #8b949e);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    padding: 4px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    cursor: pointer;
    user-select: all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-status-detail-trace:hover {
    color: var(--text-primary);
    border-color: var(--accent-color, #2EC8B8);
}

.app-status-detail-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.04));
    padding: 12px 16px;
    border-radius: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.app-status-detail-empty {
    font-size: 14px;
    color: var(--text-secondary, #8b949e);
    padding: 24px 0;
    text-align: center;
}

.app-create-events-wrap {
    max-height: 60vh;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.app-create-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.app-create-events-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.04));
    color: var(--text-secondary, #8b949e);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    white-space: nowrap;
}

.app-create-events-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    vertical-align: top;
    color: var(--text-primary);
    line-height: 1.5;
}

.app-create-events-table tbody tr:last-child td {
    border-bottom: none;
}

.app-create-events-table .event-detail {
    white-space: pre-wrap;
    word-break: break-word;
}

.app-create-events-table .event-detail-error {
    color: var(--accent-danger, #f85149);
}

.app-links {
    display: flex;
    gap: 6px;
}

.app-links .btn-action {
    margin-right: 0;
}

.app-card-field-link .btn-link-prod {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-links .btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-link-test {
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary);
}

.btn-link-test:hover {
    background: rgba(46, 200, 184, 0.25);
}

.btn-link-prod {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.btn-link-prod:hover {
    background: rgba(63, 185, 80, 0.25);
}

.app-name-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-name-text,
.app-creator {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deployment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.deployment-badge.cloud {
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary);
}

.deployment-badge.local {
    background: rgba(199, 123, 43, 0.15);
    color: var(--accent-purple);
}

.app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-card-actions .app-actions {
    justify-content: flex-start;
}

.app-actions .btn-action {
    margin-right: 0;
}

@media (max-width: 768px) {
    .apps-card-container {
        padding: 12px;
    }

    .apps-card-grid {
        grid-template-columns: 1fr;
    }

    .app-card {
        padding: 16px;
    }

    .app-card-field {
        grid-template-columns: 1fr;
        gap: 6px;
        align-items: flex-start;
    }
}

.page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.task-page-size {
    min-width: 76px;
    padding: 6px 28px 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.task-page-size:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}

.task-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.task-pagination-summary,
.task-page-info {
    color: var(--text-secondary);
    font-size: 13px;
}

.task-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-pagination .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
}

.status-running {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
    font-weight: 500;
}

.status-suspended {
    background-color: #f39c12;
    color: white;
}

.status-completed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

/* Action Buttons */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
    margin-right: 8px;
}

.btn-edit {
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary);
}

.btn-edit:hover {
    background: rgba(46, 200, 184, 0.25);
}

.btn-delete {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

.btn-delete:hover {
    background: rgba(248, 81, 73, 0.25);
}

.btn-reset {
    background: rgba(255, 180, 50, 0.15);
    color: #ffb432;
}

.btn-reset:hover {
    background: rgba(255, 180, 50, 0.25);
}

.btn-info {
    background: rgba(199, 123, 43, 0.15);
    color: var(--accent-purple);
}

.btn-info:hover {
    background: rgba(199, 123, 43, 0.25);
}

.btn-chat {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.btn-chat:hover {
    background: rgba(63, 185, 80, 0.25);
}

.btn-preview {
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary);
}

.btn-preview:hover {
    background: rgba(46, 200, 184, 0.25);
}

.btn-deploy {
    background: rgba(199, 123, 43, 0.15);
    color: var(--accent-purple);
}

.btn-deploy:hover {
    background: rgba(199, 123, 43, 0.25);
}

.btn-cancel {
    background: rgba(255, 180, 50, 0.15);
    color: #ffb432;
}

.btn-cancel:hover {
    background: rgba(255, 180, 50, 0.25);
}

.btn-retry {
    background: rgba(59, 130, 246, 0.15);
    color: #2EC8B8;
}

.btn-retry:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* Deploy Records Table */
.deploy-records-container {
    max-height: 500px;
    overflow-y: auto;
}

.deploy-records-table {
    width: 100%;
}

.deploy-records-table th,
.deploy-records-table td {
    padding: 10px 12px;
    font-size: 13px;
}

.deploy-desc-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deploy-detail-cell {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    color: var(--text-muted);
}

.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.env-badge.env-test {
    background: rgba(43, 147, 213, 0.12);
    color: var(--accent-primary);
}

.env-badge.env-prod {
    background: rgba(199, 123, 43, 0.12);
    color: var(--accent-purple);
}

.deploy-status-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.deploy-status-chip.status-pending {
    background: rgba(210, 153, 34, 0.12);
    color: var(--accent-warning);
}

.deploy-status-chip.status-publishing {
    background: rgba(43, 147, 213, 0.12);
    color: var(--accent-primary);
}

.deploy-status-chip.status-failed {
    background: rgba(248, 81, 73, 0.12);
    color: var(--accent-danger);
}

.deploy-status-chip.status-success {
    background: rgba(63, 185, 80, 0.12);
    color: var(--accent-success);
}

.deploy-status-chip.status-cancel {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-muted);
}

/* Task Detail Modal Styles */
.task-detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-detail-section h4 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.task-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-link-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(46, 200, 184, 0.1);
    border: 1px solid rgba(46, 200, 184, 0.3);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 13px;
    transition: var(--transition);
}

.task-link-item:hover {
    background: rgba(46, 200, 184, 0.2);
    border-color: var(--accent-primary);
}

.task-desc-text {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.links-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.links-editor .types-table {
    margin-bottom: 0;
}

.links-editor .types-table input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.links-editor .types-table input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

/* 只读字段样式 */
.readonly-field {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 表单行 - 并排布局 */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group-half {
    flex: 2;
    min-width: 0;
}

.form-group-quarter {
    flex: 1;
    min-width: 0;
}

/* 自适应宽弹窗：用于内容较丰富的弹窗（如"添加应用"、"创建详情"），
   小屏笔记本（~1280px）下达到 ~830px，桌面大屏（≥1440px）下到 936px，
   超过 1500px 视口时被 960px 上限封顶，避免过宽影响阅读 */
.modal.modal-wide {
    max-width: clamp(560px, 65vw, 960px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.modal-wide .modal-content {
    flex: 1;
    overflow-y: auto;
}

/* 「分享至 Blog」：内容是两列勾选 + 长文本，比 .modal-wide 再宽一档，
   并且完全跟着视口走——小屏笔记本约 1000px，大屏封顶 1280px。
   高度上永远不超过视口，内部拆成「标题栏 + 可滚动正文 + 常驻底栏」，
   保证屏幕再矮也能看到并点到「发布」。 */
.modal.modal-share-blog {
    max-width: clamp(560px, 82vw, 1280px);
    max-height: calc(100vh - 40px);
}

/* 滚动和 padding 都交给 .share-blog-form 里的正文区，
   这样底栏才能贴住弹窗底边，而不是跟着正文一起滚走。 */
.modal.modal-share-blog .modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.modal.modal-support-detail {
    max-width: clamp(520px, 72vw, 880px);
    min-height: min(560px, calc(100vh - 40px));
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
}

.modal.modal-support-detail .modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Task Edit Modal - larger size */
.modal.modal-task-edit,
.modal.modal-task-detail {
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.modal-task-edit .modal-content,
.modal.modal-task-detail .modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.modal-task-edit .task-edit-content,
.modal.modal-task-detail .task-detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 滚动区域 */
.task-edit-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
    min-height: 0;
}

/* 描述框所在的 form-group 不设置 flex */
.task-edit-scroll .form-group {
    flex-shrink: 0;
}

/* 自定义滚动条样式 */
.task-edit-scroll::-webkit-scrollbar {
    width: 6px;
}

.task-edit-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.task-edit-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.task-edit-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 任务描述 - 自适应高度 */
.modal.modal-task-edit #task-edit-desc,
.modal.modal-task-detail #task-detail-desc {
    min-height: 120px;
    height: 150px;
    max-height: 800px;
    resize: vertical;
}

/* 任务描述文本 - 查看模式 */
.task-desc-text {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal.modal-task-edit .modal-actions,
.modal.modal-task-detail .modal-actions {
    flex-shrink: 0;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal.modal-task-edit .modal-actions .btn-primary,
.modal.modal-task-edit .modal-actions .btn-secondary,
.modal.modal-task-detail .modal-actions .btn-primary,
.modal.modal-task-detail .modal-actions .btn-secondary {
    min-width: 80px;
    padding: 8px 24px;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state.show {
    display: flex;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 应用页空状态：引导式提示 + 教程入口 */
.apps-empty-guide {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    gap: 8px;
}

.apps-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.apps-empty-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.apps-empty-hint {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.apps-empty-link {
    margin-top: 12px;
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--accent-primary);
    text-decoration: none;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    transition: background-color 150ms ease, color 150ms ease;
}

.apps-empty-link:hover {
    background-color: var(--accent-primary);
    color: #fff;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

/* 弹窗默认就要能收进视口：.modal 全局是 overflow:hidden，一旦内容比屏幕高，
   底部的操作按钮会被直接裁掉且没有滚动条。所以基础样式统一按
   「头部固定 + 内容区自己滚动」的列布局来，遮罩上下各 20px padding，
   因此高度上限取 calc(100vh - 40px)。 */
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    flex: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 内容区是唯一的滚动容器：min-height:0 必须写，否则 flex item 的自动最小尺寸
   会顶着内容高度不肯收缩，弹窗照样被撑出屏幕。 */
.modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-content > form > .btn-primary {
    width: 100%;
    margin-top: 8px;
}

.modal.modal-new-user-gift {
    max-width: 520px;
    overflow: hidden;
}

.new-user-gift-celebration {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px 4px;
    overflow: hidden;
}

.new-user-fireworks {
    position: absolute;
    inset: -24px 0 auto 0;
    height: 180px;
    pointer-events: none;
}

.new-user-fireworks span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow:
        0 -28px 0 #f0b429,
        20px -20px 0 #ff7b72,
        28px 0 0 var(--accent-success),
        20px 20px 0 var(--accent-purple),
        0 28px 0 #2EC8B8,
        -20px 20px 0 #f0b429,
        -28px 0 0 #ff7b72,
        -20px -20px 0 var(--accent-success);
    animation: newUserFirework 1.4s ease-out infinite;
    opacity: 0;
}

.new-user-fireworks span:nth-child(1) { top: 56px; left: 18%; animation-delay: 0s; }
.new-user-fireworks span:nth-child(2) { top: 42px; left: 74%; animation-delay: 0.18s; transform: scale(0.8); }
.new-user-fireworks span:nth-child(3) { top: 96px; left: 54%; animation-delay: 0.34s; transform: scale(0.7); }
.new-user-fireworks span:nth-child(4) { top: 118px; left: 28%; animation-delay: 0.52s; transform: scale(0.65); }
.new-user-fireworks span:nth-child(5) { top: 74px; left: 88%; animation-delay: 0.7s; transform: scale(0.55); }
.new-user-fireworks span:nth-child(6) { top: 126px; left: 80%; animation-delay: 0.88s; transform: scale(0.6); }

@keyframes newUserFirework {
    0% { opacity: 0; transform: scale(0.2); }
    18% { opacity: 1; }
    65% { opacity: 0.9; }
    100% { opacity: 0; transform: scale(1.25); }
}

.new-user-gift-icon {
    position: relative;
    z-index: 1;
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 16px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), transparent 36%),
        linear-gradient(135deg, rgba(46, 200, 184, 0.24), rgba(199, 123, 43, 0.28));
    border: 1px solid rgba(46, 200, 184, 0.35);
    box-shadow: 0 16px 40px rgba(46, 200, 184, 0.18);
}

.new-user-gift-icon-img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 16px;
}

.new-user-gift-icon-fallback {
    font-size: 42px;
    line-height: 1;
}

.new-user-gift-celebration h4 {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 22px;
    color: var(--text-primary);
}

.new-user-gift-message,
.new-user-gift-next {
    position: relative;
    z-index: 1;
    max-width: 390px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.65;
}

.new-user-gift-message {
    font-size: 15px;
}

.new-user-gift-next {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.new-user-gift-celebration .btn-primary {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: 22px;
}

/* Status Select */
.status-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.status-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Status Select with status colors */
.status-select.status-running {
    background: rgba(79, 70, 229, 0.25);
    color: #6366f1;
    border-color: rgba(79, 70, 229, 0.4);
    font-weight: 500;
}

.status-select.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.status-select.status-suspended {
    background-color: #f39c12;
    color: white;
    border-color: rgba(243, 156, 18, 0.5);
}

.status-select.status-completed {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.25);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success {
    border-color: var(--accent-success);
}

.toast.success::before {
    content: '✓';
    color: var(--accent-success);
    font-weight: bold;
}

.toast.error {
    border-color: var(--accent-danger);
}

.toast.error::before {
    content: '✕';
    color: var(--accent-danger);
    font-weight: bold;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .auth-card {
        padding: 24px;
    }

    .view-header {
        align-items: flex-start;
    }

    .view-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .config-tabs-nav {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .config-section {
        padding: 18px;
    }

    .config-section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .config-add-btn {
        align-self: flex-start;
    }

    .app-basic-grid {
        grid-template-columns: 1fr;
    }

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

    .env-var-key-input,
    .env-var-val-input {
        width: 100%;
        min-width: 0;
    }

    .env-var-eq {
        display: none;
    }

    .env-var-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .repo-card-header,
    .repo-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .repo-field-row .repo-field.repo-field-short,
    .repo-field-row.repo-field-row-3 .repo-field.repo-field-url {
        flex: 1 1 auto;
        min-width: 0;
    }

    .apps-table {
        min-width: 0;
    }

    .apps-table thead {
        display: none;
    }

    .apps-table,
    .apps-table tbody,
    .apps-table tr,
    .apps-table td {
        display: block;
        width: 100%;
    }

    .apps-table tbody {
        padding: 14px;
    }

    .apps-table tbody tr {
        margin-bottom: 14px;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(46, 200, 184, 0.04), rgba(13, 17, 23, 0));
        box-shadow: var(--shadow-sm);
    }

    .apps-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .apps-table tbody tr:hover {
        background: linear-gradient(180deg, rgba(46, 200, 184, 0.08), rgba(13, 17, 23, 0));
    }

    .apps-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

    .apps-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .apps-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        text-align: left;
    }

    .apps-table td[data-label="名称"],
    .apps-table td[data-label="操作"] {
        align-items: flex-start;
        text-align: left;
    }

    .apps-table td[data-label="名称"] {
        flex-direction: column;
        gap: 8px;
    }

    .apps-table td[data-label="名称"]::before {
        width: 100%;
    }

    .apps-table td[data-label="操作"] {
        flex-direction: column;
        gap: 12px;
    }

    .apps-table td[data-label="操作"]::before {
        width: 100%;
    }

    .apps-table .app-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .apps-table .app-actions .btn-action {
        flex: none;
        text-align: center;
    }

    .task-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar {
        width: min(260px, 80vw);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.45);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        padding: 16px 12px;
        padding-top: 56px;
    }

    .task-pagination {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== Task Key Style ===== */
.task-key {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
}

/* ===== Type Tag ===== */
.type-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(199, 123, 43, 0.15);
    color: var(--accent-purple);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== Time Display ===== */
.time-display {
    color: var(--text-secondary);
    font-size: 13px;
}

.time-display.online {
    color: var(--accent-success);
}

.time-display.offline {
    color: var(--text-muted);
}

/* ===== Types Editor ===== */
.types-editor {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.types-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.types-input-row input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.types-input-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.types-table {
    width: 100%;
    border-collapse: collapse;
}

.types-table th,
.types-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.types-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.types-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.types-table tbody tr:last-child td {
    border-bottom: none;
}

.types-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-small.btn-add {
    background: var(--accent-primary);
    color: white;
}

.btn-small.btn-add:hover {
    background: #4a90e0;
}

.btn-small.btn-delete {
    background: transparent;
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
    white-space: nowrap;
}

.btn-small.btn-delete:hover {
    background: var(--accent-danger);
    color: white;
}

/* Required field indicator */
.required {
    color: var(--accent-danger);
}

/* Text muted style */
.text-muted {
    color: var(--text-muted);
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.1);
}

/* ===== OKR Styles - Waterfall Version ===== */

/* 周期导航 */
.okr-cycle-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.cycle-type-btns {
    display: flex;
    gap: 8px;
}

.cycle-type-btn {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.cycle-type-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.cycle-type-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.cycle-period-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cycle-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.cycle-nav-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.cycle-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cycle-period-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.cycle-period-select {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
}

.cycle-period-select:hover {
    border-color: var(--accent-primary);
}

.cycle-period-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.okr-download-md-btn {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.okr-download-md-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* 瀑布流容器 */
.okr-waterfall-container {
    max-width: 900px;
}

.okr-waterfall {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 目标块 */
.okr-objective-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
}

/* O行 */
.okr-o-row {
    display: flex;
    align-items: stretch;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.okr-reorder-side {
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    gap: 2px;
}

.okr-reorder-btn {
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-reorder-btn,
.okr-kr-row:hover .okr-reorder-btn {
    opacity: 1;
}

.okr-reorder-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.okr-reorder-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.okr-add-side {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.okr-side-add-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-side-add-btn,
.okr-kr-row:hover .okr-side-add-btn {
    opacity: 1;
}

.okr-side-add-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.okr-o-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.okr-o-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 30px;
}

.okr-inline-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.okr-inline-input:hover {
    background: var(--bg-secondary);
}

.okr-inline-input:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: 0 0 0 2px rgba(46, 200, 184, 0.2);
}

.okr-o-title {
    font-weight: 600;
    font-size: 16px;
}

.okr-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.okr-o-row:hover .okr-delete-btn,
.okr-kr-row:hover .okr-delete-btn {
    opacity: 1;
}

.okr-delete-btn:hover {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

/* KR行 */
.okr-kr-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
}

.okr-kr-row:last-child {
    border-bottom: none;
}

.okr-kr-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    padding-left: 24px;
}

.okr-kr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-purple);
    min-width: 36px;
}

.okr-kr-title {
    font-size: 14px;
}

/* 添加按钮行 */
.okr-add-row {
    padding: 8px 16px;
    padding-left: 56px;
}

.okr-add-kr-row {
    background: var(--bg-card);
}

.okr-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.okr-add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.05);
}

.okr-add-btn .add-icon {
    font-size: 16px;
    font-weight: 600;
}

.okr-add-objective {
    margin-top: 8px;
}

/* 保存指示器 */
.okr-save-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: var(--accent-success);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.okr-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm.btn-primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-sm.btn-primary:hover {
    background: #4D78D8;
}

.btn-sm.btn-danger {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border-color: transparent;
}

.btn-sm.btn-danger:hover {
    background: rgba(248, 81, 73, 0.25);
}

/* OKR Detail Modal */
.objective-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.obj-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.obj-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.obj-progress input[type="range"] {
    width: 150px;
}

.obj-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.kr-section {
    margin-top: 16px;
}

.kr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kr-section-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

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

.kr-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
}

.kr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kr-title {
    font-weight: 500;
    color: var(--text-primary);
}

.kr-actions {
    display: flex;
    gap: 6px;
}

.kr-progress-bar {
    position: relative;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    margin-bottom: 8px;
}

.kr-progress-fill {
    height: 100%;
    background: var(--accent-success);
    border-radius: 3px;
}

.kr-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    color: var(--text-secondary);
}

.kr-value {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.kr-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.kr-tasks {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.kr-tasks-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 8px;
}

.task-tag {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(46, 200, 184, 0.1);
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent-primary);
    margin-right: 6px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Form Select */
.form-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ===== TodoList Styles ===== */
.todo-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
}

.todo-add-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.todo-add-row input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.todo-add-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

.btn-add-todo {
    padding: 12px 24px;
    flex-shrink: 0;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.todo-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-content {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-success);
    cursor: pointer;
    flex-shrink: 0;
}

.todo-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
    cursor: text;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.todo-content:hover {
    background: var(--bg-secondary);
}

.todo-content-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.todo-delete {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--accent-danger);
    border-radius: 4px;
    color: var(--accent-danger);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0;
}

.todo-item:hover .todo-delete {
    opacity: 1;
}

.todo-delete:hover {
    background: var(--accent-danger);
    color: white;
}

/* Todo filter buttons */
.todo-filter-btns {
    display: flex;
    gap: 8px;
}

.todo-filter-btns .filter-btn input[type="radio"] {
    display: none;
}

/* ===== 仓库配置瀑布流样式 ===== */
.repos-waterfall {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.repos-empty-tip {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
}

.repo-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.repo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.repo-card-index {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-primary);
}

.repo-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.repo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.repo-field label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.repo-field input,
.repo-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.repo-field input:focus,
.repo-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(46, 200, 184, 0.15);
}

.repo-field textarea {
    resize: vertical;
    min-height: 60px;
}

.repo-field-row {
    display: flex;
    gap: 12px;
}

.repo-field-row .repo-field {
    flex: 1;
}

.repo-field-row .repo-field.repo-field-short {
    flex: 0 0 140px;
}

.repo-field-row.repo-field-row-3 .repo-field.repo-field-url {
    flex: 1;
    min-width: 200px;
}

/* 文档仓库标记样式 */
.repo-card-docs {
    border-color: var(--accent-success);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(63, 185, 80, 0.05) 100%);
}

.repo-card-docs .repo-card-header {
    background: rgba(63, 185, 80, 0.1);
}

.repo-docs-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
    margin-right: 12px;
}

.repo-docs-toggle input[type="radio"] {
    accent-color: var(--accent-success);
    cursor: pointer;
}

.repo-docs-label {
    color: var(--text-secondary);
    transition: var(--transition);
}

.repo-docs-toggle input[type="radio"]:checked + .repo-docs-label {
    color: var(--accent-success);
    font-weight: 600;
}

/* ===== 应用配置页面 ===== */

.view-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-back:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Tab 导航 */
.config-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 0 0;
    margin-bottom: 24px;
}

.config-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: -1px;
}
.config-tab-btn:hover:not(:disabled) {
    color: var(--text-primary);
}
.config-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.config-tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Tab 内容面板 */
.config-tab-panels {
    flex: 1;
    overflow-y: auto;
}
.config-tab-panel {
    display: none;
}
.config-tab-panel.active {
    display: block;
}

/* Section */
.config-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.config-section-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.config-section-intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.config-section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}
.config-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.config-btn-group {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.config-section-tip {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
}
.tip-info {
    background: rgba(46, 200, 184, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(46, 200, 184, 0.3);
}
.tip-warn {
    background: rgba(210, 153, 34, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.app-basic-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.app-basic-grid .form-group {
    margin-bottom: 0;
}

.app-basic-grid input,
.app-basic-grid select,
.app-basic-grid textarea {
    width: 100%;
}

.app-basic-wechat-key textarea {
    min-height: 180px;
    line-height: 1.4;
    font-size: 12px;
}

/* 密文模式：每个字符渲染成圆点。换行结构保留，便于用户大致判断 PEM 是否完整。
   -webkit-text-security 现代 Chrome / Edge / Safari / Firefox 都支持；旧浏览器
   降级为明文，眼睛图标本身仍可继续切换。 */
.app-basic-wechat-key textarea[data-masked="1"],
.app-basic-wechat-secret input[data-masked="1"] {
    -webkit-text-security: disc;
    text-security: disc;
}

.app-basic-wechat-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.app-basic-wechat-key-header label {
    margin: 0;
}

.wechat-key-toggle {
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    line-height: 1.4;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.wechat-key-toggle:hover {
    background: #f5f5f5;
}

.wechat-key-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.app-basic-name {
    max-width: 560px;
}

.app-basic-public {
    max-width: 560px;
}

.app-basic-wechat,
.app-basic-wechat-secret,
.app-basic-wechat-key {
    max-width: 560px;
}

.form-group .cfg-public-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    color: var(--text-primary);
    cursor: pointer;
}

.form-group .cfg-public-toggle input {
    width: auto;
    margin: 0;
    accent-color: var(--accent-primary);
}

.app-basic-icon {
    max-width: 560px;
}

.app-icon-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-icon-preview {
    margin-top: 10px;
}

.app-icon-preview img {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3 / 2;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    background: var(--bg-secondary);
}

.app-icon-upload-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* 环境变量列表 */
.env-vars-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.env-var-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
}
.env-var-row-editing {
    border-color: var(--accent-primary);
}
.env-var-key {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 120px;
    word-break: break-all;
}
.env-var-eq {
    color: var(--text-muted);
    flex-shrink: 0;
}
.env-var-val {
    color: var(--text-secondary);
    flex: 1;
    word-break: break-all;
}
.env-var-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}
.env-var-key-input {
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 140px;
    width: 240px;
}
.env-var-key-input,
.env-var-key-select {
    min-width: 0;
    flex: 1 1 240px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 12px;
}

.env-var-key-select {
    cursor: pointer;
}

.env-var-key-input:focus,
.env-var-key-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}
.env-var-val-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    flex: 1;
}
.env-var-val-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}
.env-var-key-input:disabled,
.env-var-val-input:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}
.btn-save-sm {
    padding: 4px 10px;
    background: var(--accent-success);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: var(--transition);
}
.btn-save-sm:hover {
    opacity: 0.85;
}
.btn-cancel-sm {
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: var(--transition);
}
.btn-cancel-sm:hover {
    background: var(--bg-tertiary);
}

/* ===== Commerce Management Shared Styles ===== */
#products-view .commerce-card,
#orders-view .commerce-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

#products-view .commerce-card-gap,
#orders-view .commerce-card-gap {
    margin-top: 16px;
}

#products-view .section-title,
#orders-view .section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

#products-view .commerce-row,
#orders-view .commerce-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#products-view .commerce-col,
#orders-view .commerce-col {
    flex: 1;
    min-width: 160px;
}

#products-view .commerce-label,
#orders-view .commerce-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

#products-view .commerce-form input,
#products-view .commerce-form select,
#orders-view .commerce-filter-row input,
#orders-view .commerce-filter-row select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
}

#products-view .commerce-form input::placeholder,
#orders-view .commerce-filter-row input::placeholder {
    color: var(--text-muted);
}

#products-view .commerce-form input:focus,
#products-view .commerce-form select:focus,
#orders-view .commerce-filter-row input:focus,
#orders-view .commerce-filter-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

#orders-view .commerce-filter-row select {
    cursor: pointer;
}

#orders-view .commerce-filter-row select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#products-view .commerce-checkbox-row {
    margin-top: 12px;
}

#products-view .commerce-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

#products-view .commerce-checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

#products-view .commerce-actions-row {
    margin-top: 16px;
}

#orders-view .commerce-filter-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 1px;
}

#orders-view .commerce-filter-actions .btn-primary {
    padding: 8px 20px;
}

#products-view .commerce-table-wrap,
#orders-view .commerce-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
}

#products-view .commerce-table,
#orders-view .commerce-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#products-view .commerce-table thead th,
#orders-view .commerce-table thead th {
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
}

#products-view .commerce-table tbody td,
#orders-view .commerce-table tbody td {
    padding: 10px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

#products-view .commerce-table tbody tr,
#orders-view .commerce-table tbody tr {
    transition: var(--transition);
}

#products-view .commerce-table tbody tr:hover,
#orders-view .commerce-table tbody tr:hover {
    background: rgba(46, 200, 184, 0.04);
}

#products-view .commerce-table tbody tr:last-child td,
#orders-view .commerce-table tbody tr:last-child td {
    border-bottom: none;
}

#products-view .commerce-code,
#orders-view .commerce-code {
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

#products-view .commerce-amount,
#orders-view .commerce-amount {
    font-weight: 600;
    color: var(--accent-primary);
}

#products-view .commerce-empty-cell,
#orders-view .commerce-empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 10px !important;
    white-space: normal;
}

#products-view .commerce-muted,
#orders-view .commerce-muted {
    color: var(--text-muted);
    font-size: 12px;
}

#products-view .commerce-badge,
#orders-view .commerce-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

#products-view .commerce-product-online {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

#products-view .commerce-product-offline {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

#orders-view .commerce-order-pending {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

#orders-view .commerce-order-paid {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

#orders-view .commerce-order-failed {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

#orders-view .commerce-order-refunded {
    background: rgba(199, 123, 43, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(199, 123, 43, 0.3);
}

#orders-view .commerce-order-gift {
    background: rgba(56, 139, 253, 0.15);
    color: var(--accent-info, #388bfd);
    border: 1px solid rgba(56, 139, 253, 0.3);
}

#orders-view .commerce-order-unknown {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

#products-view .commerce-edit-btn {
    padding: 5px 12px;
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#products-view .commerce-edit-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

#products-view .commerce-offline-btn {
    padding: 5px 12px;
    font-size: 12px;
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#products-view .commerce-offline-btn:hover {
    background: rgba(248, 81, 73, 0.25);
}

#products-view .commerce-online-btn {
    padding: 5px 12px;
    font-size: 12px;
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#products-view .commerce-online-btn:hover {
    background: rgba(63, 185, 80, 0.25);
}

#orders-view .commerce-refund-btn {
    padding: 5px 12px;
    font-size: 12px;
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#orders-view .commerce-refund-btn:hover {
    background: rgba(248, 81, 73, 0.25);
}

#orders-view .commerce-pagination {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

#orders-view .commerce-page-info {
    color: var(--text-muted);
}

#orders-view .commerce-pagination .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 订单管理：整体加大字号，减轻阅读负担 */
#orders-view .section-title {
    font-size: 20px;
    margin-bottom: 18px;
}

#orders-view .commerce-label {
    font-size: 15px;
    margin-bottom: 8px;
}

#orders-view .commerce-filter-row input,
#orders-view .commerce-filter-row select {
    padding: 10px 14px;
    font-size: 16px;
}

#orders-view .commerce-filter-actions .btn-primary {
    padding: 10px 22px;
    font-size: 15px;
}

#orders-view .commerce-table {
    font-size: 15px;
}

#orders-view .commerce-table thead th {
    padding: 12px 16px;
    font-size: 13px;
    letter-spacing: 0.02em;
}

#orders-view .commerce-table tbody td {
    padding: 12px 16px;
    font-size: 15px;
}

#orders-view .commerce-table tbody td:nth-child(6) {
    white-space: normal;
    max-width: 240px;
    word-break: break-all;
}

#orders-view .commerce-code {
    font-size: 14px;
    padding: 4px 8px;
}

#orders-view .commerce-muted {
    font-size: 14px;
}

#orders-view .commerce-badge {
    font-size: 13px;
    padding: 4px 12px;
}

#orders-view .commerce-offline-btn,
#orders-view .commerce-refund-btn {
    padding: 7px 14px;
    font-size: 14px;
}

#orders-view .commerce-pagination {
    font-size: 15px;
    margin-top: 18px;
}

#orders-view .commerce-page-info {
    font-size: 15px;
}

/* 商品管理页：顶栏 + 卡片列表 */
#products-view .commerce-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

#products-view .commerce-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

#products-view .commerce-page-sub {
    margin: 6px 0 0 0;
    font-size: 15px;
    color: var(--text-secondary);
}

#products-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid rgba(46, 200, 184, 0.45);
    box-shadow: none;
    transition: var(--transition);
}

#products-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#products-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

#orders-view .commerce-input-plain {
    -moz-appearance: textfield;
}

#orders-view .commerce-input-plain::-webkit-outer-spin-button,
#orders-view .commerce-input-plain::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#products-view .commerce-products-board {
    padding: 22px 24px;
}

#products-view .commerce-products-board-title {
    font-size: 18px;
    margin-bottom: 18px;
}

#products-view .commerce-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px;
}

#products-view .commerce-products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 15px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

#products-view .commerce-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

#products-view .commerce-product-card:hover {
    border-color: rgba(46, 200, 184, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#products-view .commerce-product-card.is-offline {
    opacity: 0.88;
}

#products-view .commerce-product-card-media {
    aspect-ratio: 3 / 2;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#products-view .commerce-product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#products-view .commerce-product-card-media-placeholder {
    font-size: 40px;
    opacity: 0.35;
}

#products-view .commerce-product-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

#products-view .commerce-product-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

#products-view .commerce-product-card-name {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

#products-view .commerce-product-card-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#products-view .commerce-product-card-id {
    font-size: 12px;
    color: var(--text-muted);
}

#products-view .commerce-product-card-price {
    font-size: 22px;
    font-weight: 700;
}

#products-view .commerce-product-card-desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

#products-view .commerce-product-card-meta {
    list-style: none;
    margin: 0;
    padding: 12px 0 0 0;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

#products-view .commerce-product-card-meta li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#products-view .commerce-product-card-meta span {
    color: var(--text-muted);
    font-size: 12px;
}

#products-view .commerce-product-card-meta strong {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

#products-view .commerce-product-card-meta li:last-child {
    grid-column: 1 / -1;
}

#products-view .commerce-meta-time {
    color: var(--text-muted);
    font-weight: 500;
}

#products-view .commerce-product-card-actions {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    gap: 8px;
}

#products-view .commerce-product-card .commerce-code {
    font-size: 12px;
}

#products-view .commerce-product-card .commerce-edit-btn,
#products-view .commerce-product-card .commerce-offline-btn,
#products-view .commerce-product-card .commerce-online-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 14px;
    font-size: 14px;
}

/* 新增商品弹窗 + 简易富文本 */
.modal.modal-commerce-product {
    /* 自适应宽度：笔记本 ≥640，常规屏 ~80vw，超大屏封顶 1100 */
    width: 90%;
    max-width: clamp(640px, 80vw, 1100px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.modal.modal-commerce-product .modal-content {
    overflow-y: auto;
    max-height: min(72vh, calc(92vh - 140px));
}

.commerce-modal-form .commerce-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.commerce-modal-form .commerce-modal-field-span {
    grid-column: 1 / -1;
}

.commerce-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.commerce-modal-form input[type="text"],
.commerce-modal-form input[type="number"] {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.commerce-modal-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

.commerce-modal-desc-block {
    margin-top: 4px;
}

.commerce-richtext-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.commerce-richtext-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.commerce-rt-btn {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.commerce-rt-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.commerce-richtext-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.commerce-richtext-editor {
    min-height: 160px;
    max-height: 240px;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-primary);
    outline: none;
}

.commerce-richtext-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.commerce-richtext-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.commerce-modal-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.commerce-modal-checkbox input {
    width: auto;
    cursor: pointer;
}

.commerce-modal-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.commerce-modal-form-refined .commerce-modal-lead {
    margin: 0 0 14px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.commerce-req {
    color: var(--accent-danger);
}

.commerce-field-hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.commerce-expire-inputs {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.commerce-expire-inputs input {
    flex: 1;
    min-width: 0;
}

.commerce-expire-inputs select {
    flex: 0 0 auto;
    min-width: 88px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.commerce-file-input-hidden {
    display: none;
}

.commerce-icon-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.commerce-btn-upload {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.commerce-icon-status {
    font-size: 12px;
    color: var(--text-muted);
}

.commerce-icon-preview {
    margin-top: 10px;
}

.commerce-icon-preview img {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.commerce-desc-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
    font-family: inherit;
}

.commerce-desc-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

.commerce-modal-actions-compact {
    margin-top: 18px;
    padding-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.commerce-modal-actions-compact .btn-secondary,
.commerce-modal-actions-compact .btn-primary {
    padding: 7px 16px;
    font-size: 13px;
}

.commerce-btn-submit-create {
    font-weight: 600;
}

.commerce-modal-select {
    width: auto;
    min-width: 80px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.commerce-modal-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

@media (max-width: 520px) {
    .commerce-modal-form .commerce-modal-grid {
        grid-template-columns: 1fr;
    }
}/* ===== 商店视图 ===== */
/* 商店整体走「居中单列 + 长条商品」布局：一屏之内先看清权益，再看价格与按钮。 */
.store-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 8px 0 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.store-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 4px;
}

.store-hero-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.store-hero-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.store-products-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 0;
}

.store-product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* 长条商品：左侧名称 + 权益清单，右侧价格 + 操作 */
.store-product-strip {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.store-strip-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.store-strip-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.store-product-strip .store-product-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    color: var(--text-primary);
}

.store-strip-tag {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.store-strip-tag-active {
    color: var(--accent-primary);
    border: 1px solid currentColor;
    padding: 2px 9px;
    background: transparent;
}

.store-benefit-caption {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.store-benefit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px 20px;
}

.store-benefit-item {
    position: relative;
    padding-left: 22px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.store-benefit-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.75;
}

.store-benefit-empty {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.store-strip-side {
    flex: 0 0 216px;
    padding: 22px 24px;
    border-left: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.store-strip-price-note {
    font-size: 12px;
    color: var(--text-muted);
}

.store-strip-side .store-product-actions {
    padding: 12px 0 0;
    border-top: none;
    justify-content: center;
    flex-wrap: wrap;
}

.store-buy-btn-disabled,
.store-buy-btn-disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 海外收单是跳外部收银台，购买按钮得是真链接（新标签页打开、可右键复制），
   .btn-primary 是按 <button> 写的，这里把 <a> 拉回同样的盒模型和文字表现。 */
.store-checkout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.store-strip-region-note {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .store-product-strip {
        flex-direction: column;
    }

    .store-strip-side {
        flex: 1 1 auto;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

/* ===== 商店政策（服务条款 / 退款政策） ===== */
.store-policies {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.store-policy-head {
    text-align: center;
    margin-top: 10px;
}

.store-policy-head-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.store-policy-head-sub {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.store-policy-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.store-policy-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.store-policy-summary::-webkit-details-marker {
    display: none;
}

.store-policy-name {
    flex: 1 1 auto;
}

.store-policy-updated {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.store-policy-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.store-policy-item[open] .store-policy-caret {
    transform: rotate(-135deg);
}

.store-policy-body {
    padding: 0 18px 18px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.store-policy-body h1,
.store-policy-body h2,
.store-policy-body h3,
.store-policy-body h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 6px;
}

.store-policy-body p {
    margin: 0 0 8px;
}

.store-policy-body ul,
.store-policy-body ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.store-policy-body li {
    margin-bottom: 4px;
}

.store-policy-body a {
    color: var(--accent-primary);
}

.store-policy-body code {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12.5px;
}

/* ===== 落地页「价格与权益」=====
   商品长条和政策折叠直接复用上面的 .store-* 样式，这里只调容器与页头。 */
.lp-pricing-page {
    padding-bottom: 24px;
}

.lp-pricing-head {
    text-align: center;
    padding: 40px 0 6px;
}

.lp-pricing-head .lp-view-sub {
    margin-left: auto;
    margin-right: auto;
}

.lp-pricing-contact {
    margin: 4px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.lp-pricing-contact-btn {
    padding: 0 0 0 4px;
    border: none;
    background: none;
    font: inherit;
    color: var(--accent-primary);
    cursor: pointer;
}

.lp-pricing-contact-btn:hover {
    text-decoration: underline;
}

/* 导航里的「联系我们」：MOR 审核要在登录前找到官方联系方式，但它不该抢
   「登录 / 开始使用」的视觉权重，所以做成纯文字按钮。 */
.lp-nav-contact {
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-subtle);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.lp-nav-contact:hover {
    color: var(--text-heading);
    background: var(--surface-hover);
}

@media (max-width: 768px) {
    .lp-nav-contact {
        padding: 6px 8px;
        font-size: 13px;
    }

    .lp-pricing-head {
        padding-top: 28px;
    }
}

/* ===== feedback 邮箱弹窗 ===== */
.feedback-email-dialog {
    max-width: 520px;
}

.feedback-email-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.feedback-email-label {
    font-size: 13px;
    color: var(--text-muted);
}

.feedback-email-value {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.feedback-email-value:hover {
    text-decoration: underline;
}

.feedback-email-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feedback-email-tips-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.feedback-email-note {
    margin: 14px 0 18px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.store-product-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.store-product-header {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.store-product-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-product-icon-placeholder {
    font-size: 48px;
    opacity: 0.5;
}

.store-product-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-product-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.store-product-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.store-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.store-product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
}

.store-product-expire {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 999px;
}

.store-product-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.store-product-actions .btn-primary {
    padding: 6px 18px;
    font-size: 13px;
}

.store-product-actions .store-no-buy-tip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
}

.store-convert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.store-convert-dialog {
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1f2328);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    max-width: 480px;
    width: 100%;
    padding: 24px;
}

.store-convert-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.store-convert-lead {
    font-size: 14px;
    color: var(--text-muted, #57606a);
    margin: 0 0 16px;
    line-height: 1.6;
}

.store-convert-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    border-top: 1px solid var(--border-color, #d0d7de);
}

.store-convert-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #d0d7de);
    font-size: 14px;
}

.store-convert-list li span {
    color: var(--text-muted, #57606a);
}

.store-convert-list li strong {
    font-weight: 600;
}

.store-convert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.store-convert-actions .btn-primary {
    padding: 8px 20px;
    font-size: 14px;
}

/* ===== 商店：使用兑换码弹窗 =====
   与 .store-convert-dialog 共用外壳，但这一屏只做一件事（输入一串码），
   所以单独收窄、把码本身做成等宽 + 字距的主角，其余信息压成注脚。 */
.store-redeem-dialog {
    position: relative;
    max-width: 440px;
    padding: 28px 28px 24px;
    border: 1px solid var(--line-soft);
    animation: store-redeem-in 0.18s ease-out;
}

@keyframes store-redeem-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
}

.store-redeem-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: var(--transition, all 0.15s ease);
}

.store-redeem-close:hover {
    background: var(--surface-hover);
    color: var(--text-heading);
}

/* 强调色短线 + 加字距的栏目标签，和落地页的 .lp-eyebrow 同一套写法。 */
.store-redeem-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.store-redeem-eyebrow::before {
    content: '';
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.store-redeem-title {
    font-size: 20px;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    padding-right: 28px;
}

.store-redeem-lead {
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--text-subtle);
}

.store-redeem-field {
    margin-bottom: 16px;
}

.store-redeem-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-subtle);
}

/* 背景 / 边框 / 文字色由 themes.css 统一给（带 !important），
   这里只补它没管的排版：等宽、字距、内边距、圆角。 */
.store-redeem-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0.08em;
}

.store-redeem-input::placeholder {
    font-family: inherit;
    letter-spacing: normal;
}

/* 错误态要盖住 themes.css 里 input / input:focus 上的 !important，
   靠的是选择器特异性（0,3,0 > 0,1,1），不是加更多 !important。 */
.store-redeem-field.is-invalid .store-redeem-input,
.store-redeem-field.is-invalid .store-redeem-input:focus {
    border-color: var(--accent-danger) !important;
}

.store-redeem-field.is-invalid .store-redeem-input:focus {
    box-shadow: 0 0 0 3px rgba(201, 63, 69, 0.18) !important;
}

.store-redeem-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    min-height: 16px;
}

.store-redeem-error {
    flex: 1 1 auto;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--accent-danger);
}

.store-redeem-error[hidden] {
    display: none;
}

.store-redeem-counter {
    margin-left: auto;
    flex: none;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    color: var(--text-faint);
}

.store-redeem-counter.is-full {
    color: var(--accent-success);
}

.store-redeem-notes {
    margin: 0 0 22px;
    padding: 14px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface-panel-muted);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-subtle);
}

.store-redeem-notes li {
    position: relative;
    padding-left: 16px;
}

.store-redeem-notes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.6;
}

.store-redeem-actions {
    gap: 10px;
}

.store-redeem-actions .btn-primary,
.store-redeem-actions .btn-secondary {
    padding: 9px 20px;
    font-size: 13.5px;
    border-radius: 8px;
}

.store-redeem-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.store-redeem-confirm.is-loading {
    cursor: progress;
}

@media (max-width: 480px) {
    .store-redeem-dialog {
        padding: 24px 18px 18px;
    }

    .store-redeem-actions {
        flex-direction: column-reverse;
    }

    .store-redeem-actions .btn-primary,
    .store-redeem-actions .btn-secondary {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .store-redeem-dialog {
        animation: none;
    }
}

.commerce-modal-readonly-value {
    padding: 8px 12px;
    background: var(--bg-secondary, #f6f8fa);
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 6px;
    color: var(--text-muted, #57606a);
    font-size: 13px;
}

.store-loading-tip,
.store-empty-tip,
.store-error-tip {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    grid-column: 1 / -1;
}

.store-error-tip {
    color: var(--accent-danger);
}

/* ===== 我的视图（个人中心）===== */

#profile-view {
    width: 100%;
    margin: 0;
}

/* 基础配置区：用户 ID → 昵称 → 界面风格 → 生效中的订阅服务，一行一项。
   左边固定宽的标签列 + 右边贴合内容的控件列，行与行之间只用一条细线分隔——
   比原来「大写小标题压在整行控件上方」的堆叠更像一张设置表，也不会让 4 个字的昵称
   配一个铺满整栏的输入框。 */
.profile-basic-grid {
    display: flex;
    flex-direction: column;
}

.profile-basic-field {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 4px 20px;
    min-width: 0;
    padding: 12px 0;
    border-top: 1px solid var(--line-soft, var(--border-color));
}

.profile-basic-field:first-child {
    padding-top: 2px;
    border-top: none;
}

.profile-basic-field:last-child {
    padding-bottom: 2px;
}

/* 订阅服务是一组卡片，标签跟第一行卡片顶对齐比垂直居中好看 */
.profile-basic-field-block {
    align-items: start;
}

.profile-basic-label {
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-muted);
}

.profile-basic-field-block .profile-basic-label {
    padding-top: 4px;
}

.profile-basic-control {
    min-width: 0;
}

.profile-basic-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-basic-field-block .profile-basic-hint {
    margin-top: 0;
}

.profile-theme-select {
    width: 100%;
    max-width: 160px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

/* 窄屏下标签列没有意义，退回上下堆叠 */
@media (max-width: 640px) {
    .profile-basic-field {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .profile-basic-field-block .profile-basic-label {
        padding-top: 0;
    }
}

/* 页头右上角的「联系我们」 */
.profile-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    flex: none;
}

.profile-contact-icon {
    font-size: 15px;
    line-height: 1;
}

.profile-user-name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 昵称最多 32 字，200px 足够放下——输入框宽度按内容定档，不跟着栏宽走 */
.profile-user-name-input {
    flex: 0 1 200px;
    min-width: 140px;
    max-width: 200px;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
}

.profile-user-name-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(59, 130, 246, 0.2));
}

.profile-username-tip {
    margin-top: 6px;
    min-height: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-username-tip:empty {
    display: none;
}

.profile-username-tip.is-error {
    color: var(--accent-danger);
}

.profile-username-tip.is-success {
    color: var(--accent-success);
}

.profile-user-id-value {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading, var(--text-primary));
    letter-spacing: 0.06em;
    background: var(--surface-panel-muted, var(--bg-tertiary));
    border: 1px solid var(--line-soft, var(--border-color));
    padding: 3px 10px;
    border-radius: 6px;
}

.profile-section {
    width: 100%;
    padding: 18px;
    background: rgba(22, 27, 34, 0.72);
    border: 1px solid rgba(48, 54, 61, 0.88);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.profile-section + .profile-section {
    margin-top: 20px;
}

.profile-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.profile-section-title-row .profile-section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.profile-section-subtitle {
    margin-top: -6px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.profile-preferences-section {
    margin-bottom: 24px;
}

.profile-preferences-form {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(180px, 260px) auto;
    gap: 12px;
    align-items: end;
    justify-content: start;
}

.profile-preferences-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.profile-preferences-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.profile-preferences-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}

.profile-preferences-form .btn-small {
    min-width: 96px;
    width: auto;
    justify-self: start;
    white-space: nowrap;
}

.profile-preferences-status {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(248, 81, 73, 0.25);
    color: var(--accent-danger);
    background: rgba(248, 81, 73, 0.08);
    font-size: 12px;
}

.profile-preferences-status.completed {
    border-color: rgba(63, 185, 80, 0.25);
    color: var(--accent-success);
    background: rgba(63, 185, 80, 0.08);
}

.profile-preferences-tip {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.user-preferences-onboarding-form .profile-preferences-tip {
    margin-top: 0;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* 营销阵地：各平台营销账号档案 */
.marketing-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.marketing-account-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}
.marketing-account-card.is-open {
    border-color: var(--accent-primary);
}
.marketing-account-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
}
.marketing-account-head-main {
    flex: 1;
    min-width: 0;
}
.marketing-account-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.marketing-account-status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.marketing-account-status.is-ready {
    color: var(--accent-success);
    border-color: var(--accent-success);
}
.marketing-account-status.is-pending {
    color: var(--accent-warning);
    border-color: var(--accent-warning);
}
.marketing-account-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.marketing-account-toggle-text {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--accent-primary);
}
.marketing-account-body {
    padding: 0 14px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.marketing-account-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.marketing-account-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.marketing-account-required {
    font-size: 10px;
    padding: 0 5px;
    border-radius: 4px;
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}
.marketing-account-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.marketing-account-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}
.marketing-account-select {
    cursor: pointer;
    appearance: none;
    /* 留出右侧箭头位置，箭头用背景图画，避免各浏览器原生样式在深色主题下发白 */
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.marketing-account-input-custom {
    width: 100%;
    margin-top: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}
.marketing-account-input-custom:focus {
    outline: none;
    border-color: var(--accent-primary);
}
.marketing-account-help {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-tertiary, var(--text-secondary));
}
.marketing-account-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
/* 统一配置：永远展开，没有折叠头，视觉上和下面的平台卡片拉开一档 */
.marketing-common-profile {
    margin-top: 14px;
}
.marketing-account-card.is-common .marketing-account-head {
    cursor: default;
    border-bottom: 1px solid var(--border-color);
}
.marketing-account-card.is-common .marketing-account-body {
    padding-top: 14px;
}
/* 内容形态这类多选字段横跨两列，chips 才不会挤成一条 */
.marketing-account-field.is-wide {
    grid-column: 1 / -1;
}
/* 多选（内容形态）：一排可换行的复选框 */
.marketing-account-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.marketing-account-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}
.marketing-account-check input {
    margin: 0;
    cursor: pointer;
}
/* 图片字段（IP 头像）：一张方形预览 + 两个按钮，横排 */
.marketing-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.marketing-avatar-preview {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.marketing-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.marketing-avatar-preview.is-empty {
    border-style: dashed;
    font-size: 11px;
    color: var(--text-tertiary, var(--text-secondary));
}
.marketing-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 个人中心的头像字段：一张圆形预览 + 上传/清除两个按钮，横排。
   和 IP 头像同一套尺寸，只是这里是圆的（侧栏也按圆形显示，两处要一致）。 */
.profile-avatar-field {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-avatar-preview {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-preview.is-empty {
    border-style: dashed;
    font-size: 11px;
    color: var(--text-tertiary, var(--text-secondary));
}
.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 760px) {
    .marketing-account-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .profile-preferences-form {
        grid-template-columns: 1fr;
    }

    .profile-preferences-form .btn-small {
        justify-self: end;
    }
}

.profile-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    justify-content: start;
    gap: 12px;
}

@media (max-width: 600px) {
    .profile-quick-actions {
        grid-template-columns: 1fr;
    }
}

.profile-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background:
        linear-gradient(145deg, rgba(33, 38, 45, 0.92), rgba(22, 27, 34, 0.96));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.profile-action-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.profile-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(46, 200, 184, 0.18), rgba(63, 185, 80, 0.08));
    border: 1px solid rgba(46, 200, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-primary);
}

.profile-action-body {
    flex: 1;
    min-width: 0;
}

.profile-action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.profile-action-desc {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.45;
}

.profile-action-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: var(--transition);
}

.profile-action-card:hover .profile-action-arrow {
    color: var(--accent-primary);
    transform: translateX(2px);
}

.profile-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.service-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 12px 16px;
    transition: var(--transition);
    flex: 0 1 auto;
    max-width: 100%;
}

.service-card:hover {
    border-color: var(--accent-primary);
}

.service-card-left {
    flex-shrink: 0;
}

.service-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.service-card-icon-placeholder {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.service-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.service-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-expire-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.service-expire-permanent {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.service-expire-normal {
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
}

.service-expire-urgent {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

/* 生效中的订阅服务：左边服务卡片、右边模型调用使用量仪表。
   窄屏（≤640px 时基础配置行本来就会上下堆叠）靠 flex-wrap 自然换行。 */
.profile-services-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

/* 仪表紧挨着服务卡片，不用 flex:1 把它顶到最右边——只有一张服务卡片时，
   中间那段空白会让两块看起来毫无关系。 */
.profile-services-row > .profile-services-list {
    flex: 0 1 auto;
    min-width: 0;
}

/* 档 A/B：额度仪表和左边的服务卡片并排，用同一套 padding 与两行正文，
   高度对齐；左列是说明文字、右列是百分比与进度条。 */
.model-usage-card {
    flex: 0 0 auto;
    max-width: 100%;
    /* 和左边的服务卡片等高：行的高度由服务卡片决定，这里跟着拉伸再把内容居中。 */
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--surface-panel-muted, var(--bg-secondary));
    border: 1px solid var(--line-default, var(--border-color));
    border-radius: var(--border-radius-lg);
}

.model-usage-card[hidden] {
    display: none;
}

.model-usage-labels {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.model-usage-meter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* 进度条要有确定宽度才读得出长短，跟着百分比文字宽度走会忽长忽短。 */
    width: 120px;
    flex: 0 0 auto;
}

.model-usage-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    white-space: nowrap;
}

.model-usage-percent {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.model-usage-percent.is-warning {
    color: var(--accent-warning);
}

.model-usage-percent.is-danger {
    color: var(--accent-danger);
}

/* 进度条本身只有 6px，撑不起和左边说明文字同高的一行，
   套一层文本行高的盒子把它居中，两列的第二行才对得齐。 */
.model-usage-bar {
    position: relative;
    height: 6px;
    margin: 5px 0;
    border-radius: 3px;
    background: var(--surface-inset, var(--bg-tertiary));
    overflow: hidden;
}

.model-usage-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--accent-primary);
    transition: var(--transition);
}

.model-usage-fill.is-warning {
    background: var(--accent-warning);
}

.model-usage-fill.is-danger {
    background: var(--accent-danger);
}

.model-usage-hint,
.model-usage-error {
    font-size: 12px;
    line-height: 1.33;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .model-usage-fill {
        transition: none;
    }
}

/* 订单状态徽标 */
.order-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.order-status-badge.status-paid {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.order-status-badge.status-pending {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

.order-status-badge.status-refunded {
    background: rgba(199, 123, 43, 0.12);
    color: var(--accent-purple);
}

.order-status-badge.status-failed {
    background: rgba(248, 81, 73, 0.12);
    color: var(--accent-danger);
}

.order-status-badge.status-gift {
    background: rgba(56, 139, 253, 0.12);
    color: var(--accent-info, #388bfd);
}

/* 工单 */
.profile-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.support-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.support-status-running {
    color: var(--accent-warning);
    background: rgba(210, 153, 34, 0.14);
}

.support-status-pending {
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.12);
}

.support-status-completed {
    color: var(--accent-success);
    background: rgba(63, 185, 80, 0.12);
}

.support-detail-row td {
    background: rgba(46, 200, 184, 0.04);
}

.support-chat-box {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.modal-support-detail .support-chat-box {
    flex: 1;
    min-height: 0;
}

.support-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding: 12px;
}

.modal-support-detail .support-messages {
    flex: 1;
    min-height: 260px;
    max-height: none;
}

.support-message {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.support-message.user {
    align-self: flex-end;
    border-color: rgba(46, 200, 184, 0.25);
    background: rgba(46, 200, 184, 0.10);
}

.support-message.admin {
    align-self: flex-start;
}

.support-message-meta {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.support-message-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.support-message-files,
.support-pending-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.support-message-files {
    margin-top: 8px;
}

.support-pending-files {
    margin: 0 0 6px;
}

.support-file-link,
.support-pending-file {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.08);
    font-size: 12px;
}

.support-pending-file button {
    color: var(--text-muted);
}

.support-composer-box .support-pending-files:not(:empty) {
    padding: 10px 12px 0;
}

.support-composer {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.support-composer-box {
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.support-composer-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.08);
}

.support-textarea {
    display: block;
    width: 100%;
    min-height: 40px;
    max-height: 160px;
    resize: none;
    overflow-y: auto;
    padding: 10px 12px 4px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    line-height: 1.5;
}

.support-textarea::placeholder {
    color: var(--text-muted);
}

.support-composer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px 10px 8px;
}

.support-attach-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    transition: var(--transition);
}

.support-attach-btn:hover {
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
}

.support-composer-hint {
    flex: 1;
    color: var(--text-muted);
    font-size: 12px;
}

.support-send-btn {
    padding: 5px 14px;
    background: var(--accent-primary);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.support-send-btn:hover {
    background: #4D78D8;
    transform: translateY(-1px);
}

.support-create-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-create-form .commerce-input,
#support-view .commerce-input,
#support-view .commerce-input-plain {
    width: 100%;
    padding: 8px 10px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* ===== 工单处理（admin） ===== */
#support-view .commerce-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

#support-view .commerce-card-gap {
    margin-top: 16px;
}

#support-view .section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px 0;
}

#support-view .commerce-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#support-view .commerce-col {
    flex: 1;
    min-width: 180px;
}

#support-view .commerce-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#support-view .commerce-filter-row input,
#support-view .commerce-filter-row select,
#support-view .commerce-table select.commerce-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 36px 10px 14px;
    font-size: 15px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
}

#support-view .commerce-filter-row input::placeholder {
    color: var(--text-muted);
}

#support-view .commerce-filter-row select,
#support-view .commerce-table select.commerce-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

#support-view .commerce-filter-row select option,
#support-view .commerce-table select.commerce-input option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#support-view .commerce-filter-row input:focus,
#support-view .commerce-filter-row select:focus,
#support-view .commerce-table select.commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

#support-view .commerce-filter-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 1px;
}

#support-view .commerce-filter-actions .btn-primary {
    padding: 10px 22px;
    font-size: 15px;
    white-space: nowrap;
}

#support-view .commerce-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

#support-view .commerce-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 15px;
}

#support-view .commerce-table thead th {
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-color);
}

#support-view .commerce-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

#support-view .commerce-table tbody tr {
    transition: var(--transition);
}

#support-view .commerce-table tbody tr:hover {
    background: rgba(46, 200, 184, 0.04);
}

#support-view .commerce-table tbody tr:last-child td {
    border-bottom: none;
}

#support-view .commerce-table th:nth-child(1),
#support-view .commerce-table td:nth-child(1) {
    width: 190px;
}

#support-view .commerce-table th:nth-child(2),
#support-view .commerce-table td:nth-child(2) {
    width: 92px;
}

#support-view .commerce-table th:nth-child(3),
#support-view .commerce-table td:nth-child(3) {
    width: 96px;
}

#support-view .commerce-table th:nth-child(4),
#support-view .commerce-table td:nth-child(4),
#support-view .commerce-table th:nth-child(5),
#support-view .commerce-table td:nth-child(5) {
    width: 130px;
}

#support-view .commerce-table th:nth-child(7),
#support-view .commerce-table td:nth-child(7) {
    width: 180px;
}

#support-view .commerce-table th:nth-child(8),
#support-view .commerce-table td:nth-child(8) {
    width: 150px;
}

#support-view .commerce-table tbody td:nth-child(6) {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

#support-view .commerce-table select.commerce-input {
    min-width: 0;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 14px;
}

#support-view .commerce-code {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
}

#support-view .commerce-empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 10px !important;
    white-space: normal;
}

#support-view .commerce-muted {
    color: var(--text-muted);
    font-size: 14px;
}

#support-view .commerce-pagination {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

#support-view .commerce-page-info {
    color: var(--text-muted);
}

#support-view .commerce-pagination .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#support-view .support-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#support-view .btn-small {
    white-space: nowrap;
}

@media (max-width: 768px) {
    #support-view .commerce-filter-actions,
    #support-view .commerce-filter-actions .btn-primary {
        width: 100%;
    }
}

/* ===== 运维工具（admin） ===== */
#ops-view .commerce-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

#ops-view .section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px 0;
}

#ops-view .commerce-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#ops-view .commerce-col {
    flex: 1;
    min-width: 220px;
}

#ops-view .commerce-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#ops-view .commerce-filter-row input,
#ops-view .commerce-filter-row select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    font-size: 15px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
}

#ops-view .commerce-filter-row input::placeholder {
    color: var(--text-muted);
}

#ops-view .commerce-filter-row select {
    cursor: pointer;
}

#ops-view .commerce-filter-row input:focus,
#ops-view .commerce-filter-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

#ops-view .commerce-filter-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 1px;
}

#ops-view .commerce-filter-actions .btn-primary {
    padding: 10px 24px;
}

#ops-view .ops-tool-hint {
    margin: 14px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 768px) {
    #ops-view .commerce-filter-actions,
    #ops-view .commerce-filter-actions .btn-primary {
        width: 100%;
    }
}

.support-empty {
    color: var(--text-muted);
    text-align: center;
}

.support-feedback-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(46, 200, 184, 0.20);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46, 200, 184, 0.10), rgba(199, 123, 43, 0.08));
}

.support-feedback-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
}

.support-feedback-sub {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.support-feedback-contact-title {
    margin-bottom: 12px;
}

/* ===== 礼品（gifts）视图 ===== */
#gifts-view .commerce-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

#gifts-view .commerce-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

#gifts-view .commerce-page-sub {
    margin: 6px 0 0 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
}

#gifts-view .gift-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 20px;
    max-width: 960px;
}

@media (max-width: 900px) {
    #gifts-view .gift-layout {
        grid-template-columns: 1fr;
    }
}

#gifts-view .card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

/* 预览卡片 */
#gifts-view .gift-preview-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

#gifts-view .gift-preview-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 0% 0%, rgba(46, 200, 184, 0.08), transparent 60%);
    pointer-events: none;
}

#gifts-view .gift-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

#gifts-view .gift-preview-kicker {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#gifts-view .gift-preview-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

#gifts-view .gift-preview-state.is-active {
    background: rgba(63, 185, 80, 0.14);
    color: var(--accent-success);
    border-color: rgba(63, 185, 80, 0.35);
}

#gifts-view .gift-preview-state.is-active::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2);
}

#gifts-view .gift-preview-body {
    position: relative;
    min-height: 140px;
    display: flex;
}

#gifts-view .gift-preview-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 0;
    text-align: center;
    color: var(--text-muted);
}

#gifts-view .gift-preview-empty-icon {
    font-size: 34px;
    opacity: 0.6;
    margin-bottom: 2px;
}

#gifts-view .gift-preview-empty-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

#gifts-view .gift-preview-empty-sub {
    font-size: 12px;
    color: var(--text-muted);
}

#gifts-view .gift-preview-item {
    display: flex;
    gap: 16px;
    width: 100%;
    align-items: center;
}

#gifts-view .gift-preview-thumb {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

#gifts-view .gift-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#gifts-view .gift-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#gifts-view .gift-preview-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#gifts-view .gift-preview-key {
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 6px;
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#gifts-view .gift-preview-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

#gifts-view .gift-preview-meta span strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

/* 表单卡片 */
#gifts-view .gift-form-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#gifts-view .gift-form-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

#gifts-view .gift-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#gifts-view .gift-form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

#gifts-view .gift-form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#gifts-view .gift-product-select {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238b949e' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

#gifts-view .gift-product-select:hover {
    border-color: rgba(46, 200, 184, 0.4);
}

#gifts-view .gift-product-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.15);
}

#gifts-view .gift-product-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#gifts-view .gift-save-btn {
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 500;
    flex: 0 0 auto;
    white-space: nowrap;
}

#gifts-view .gift-form-hint {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.text-muted {
    color: var(--text-muted);
}

/* ===== 图片裁剪弹窗 ===== */
.image-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-crop-dialog {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.image-crop-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.image-crop-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.image-crop-close:hover {
    color: var(--text-primary);
}

.image-crop-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.image-crop-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.image-crop-canvas-wrap:active {
    cursor: grabbing;
}

.image-crop-canvas-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.image-crop-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.image-crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.image-crop-zoom-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.image-crop-zoom-slider {
    flex: 1;
    accent-color: var(--accent-primary, #2EC8B8);
}

.image-crop-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
}

.image-crop-footer .btn-primary,
.image-crop-footer .btn-secondary {
    flex: none;
}

/* ===== 应用配置向导 Wizard ===== */

/* 向导顶部流程条 */
/* 向导左右布局 */
.wizard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧纵向tab栏 */
.wizard-sidebar {
    width: 160px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 12px 0;
    overflow-y: auto;
}

.wizard-sidebar-tab {
    padding: 10px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.wizard-sidebar-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.wizard-sidebar-tab.active {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

/* 向导内容区域 */
.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.wizard-step-panel {
    display: none;
}

.wizard-step-panel.active {
    display: block;
}

/* 向导头部操作按钮 */
.wizard-header-actions {
    display: flex;
    gap: 8px;
}

/* 向导视图布局 */
#app-config-view.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.wizard-view-header {
    flex-shrink: 0;
}

/* 环境切换标签 */
.wizard-env-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.wizard-env-tab {
    padding: 6px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    margin-bottom: -1px;
}

.wizard-env-tab:hover {
    color: var(--text-primary);
}

.wizard-env-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 500;
}

/* 基础设施表单网格 */
.infra-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 20px;
}

/* 服务器步骤表单容器：服务器类型下拉在上，类型对应表单在下 */
.server-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 520px;
}

.server-mode-field {
    max-width: 240px;
}

.server-type-hint {
    margin-top: 6px;
    color: var(--text-muted, var(--text-secondary));
    font-size: 12px;
    line-height: 1.5;
}

/* 向导里的深色下拉（与 .domain-select 保持一致；新增类以便在其它步骤复用） */
.cfg-dark-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    background-color: var(--bg-tertiary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cfg-dark-select:hover:not(:disabled) {
    border-color: var(--accent-primary);
}

.cfg-dark-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.cfg-dark-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 下拉菜单项：强制使用深色背景（仅 Chromium/Firefox 可生效，Safari 受限于系统样式） */
.cfg-dark-select option,
.cfg-dark-select optgroup {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 基础设施列表 */
.infra-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.infra-list-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.domain-public-notice {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.domain-public-notice code {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 5px;
}

.infra-list-row input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 13px;
}

.infra-list-row input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

/* 域名步骤的下拉：与整体深色表单保持一致，替换浏览器默认样式 */
.infra-list-row select,
.domain-select {
    flex: 1;
    padding: 8px 32px 8px 12px;
    background-color: var(--bg-tertiary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.infra-list-row select:hover:not(:disabled),
.domain-select:hover:not(:disabled) {
    border-color: var(--accent-primary);
}

.infra-list-row select:focus,
.domain-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.infra-list-row select:disabled,
.domain-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 下拉列表项：强制使用深色背景，Firefox 和 Chromium 对 option 支持都有限，
   仅设置最基础的背景与文字色，确保打开时不再出现白底黑字 */
.infra-list-row select option,
.domain-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 域名步骤的行：单选场景下内容不宜太宽，控制最大宽度并左对齐 */
#domains-list.infra-list {
    max-width: 520px;
}

/* ===== 生产环境子域名子配置卡片（wizard / modal / agent 卡片复用） ===== */
.domain-subdomain-panel {
    position: relative;
    margin-top: 10px;
    padding: 12px 14px 12px 16px;
    background: linear-gradient(180deg, rgba(46, 200, 184, 0.05) 0%, rgba(46, 200, 184, 0.02) 100%);
    border: 1px solid rgba(46, 200, 184, 0.25);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--border-radius);
}

.domain-subdomain-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.domain-subdomain-head-icon {
    flex: none;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.domain-subdomain-head-label {
    font-weight: 500;
    color: var(--text-primary);
}

.domain-subdomain-head-tip {
    color: var(--text-muted);
}

.domain-subdomain-field {
    display: flex;
    align-items: stretch;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.domain-subdomain-field:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(46, 200, 184, 0.18);
}

.domain-subdomain-field.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.domain-subdomain-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    letter-spacing: 0.2px;
}

.domain-subdomain-input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-family, inherit);
    letter-spacing: normal;
}

.domain-subdomain-suffix {
    flex: none;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    user-select: none;
}

.domain-subdomain-suffix-dot {
    color: var(--text-muted);
    margin-right: 1px;
}

.domain-subdomain-preview {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(63, 185, 80, 0.08);
    border: 1px dashed rgba(63, 185, 80, 0.35);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.domain-subdomain-preview-label {
    color: var(--text-muted);
    margin-right: 6px;
}

.domain-subdomain-preview-value {
    color: var(--accent-success);
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-weight: 600;
}

.domain-subdomain-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

/* 基础设施卡片（数据库） */
.infra-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 12px;
}

.infra-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.infra-card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 必填标记 */
.required-mark {
    color: var(--accent-danger);
    margin-left: 2px;
}

/* 向导步骤标题下的副标题 */
.wizard-step-panel .config-section-subtitle {
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== 权限配置视图 ===== */

#permissions-view .perm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

#permissions-view .section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.perm-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.perm-group-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.perm-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.perm-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.perm-key-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

.perm-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
}

.perm-type-sub {
    background: rgba(52, 199, 89, 0.15);
    color: var(--accent-success);
}

.perm-type-count {
    background: rgba(255, 149, 0, 0.15);
    color: var(--accent-warning);
}

.perm-type-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.perm-table {
    width: 100%;
    border-collapse: collapse;
}

.perm-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.perm-table tbody td {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.perm-table tbody tr:last-child td {
    border-bottom: none;
}

.perm-table tbody tr:hover {
    background: var(--bg-secondary);
}

.perm-actions-cell {
    white-space: nowrap;
}

.perm-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.perm-action-btn:hover {
    opacity: 1;
    background: var(--bg-primary);
}

.perm-text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.perm-empty,
.perm-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 0;
    font-size: 14px;
}

/* 通用弹窗覆盖层 */
.commerce-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.perm-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s ease;
}

.perm-modal .commerce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.perm-modal .commerce-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.perm-modal .commerce-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.perm-modal .commerce-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.perm-form {
    padding: 20px;
}

.perm-form .commerce-form-group {
    margin-bottom: 16px;
}

.perm-form .commerce-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.perm-form .commerce-label .required {
    color: var(--accent-danger);
}

.perm-form .commerce-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}

.perm-form .commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.perm-form .commerce-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}

.perm-form .commerce-modal-footer .btn-primary,
.perm-form .commerce-modal-footer .btn-secondary {
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.perm-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 权限配置视图复用 commerce-page-head 样式 */
#permissions-view .commerce-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

#permissions-view .commerce-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

#permissions-view .commerce-page-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

#permissions-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid rgba(46, 200, 184, 0.45);
    box-shadow: none;
    transition: var(--transition);
    flex-shrink: 0;
}

#permissions-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#permissions-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

/* ===== 用户资源（admin） ===== */

#user-resources-view .commerce-page-head {
    margin-bottom: 20px;
}

#user-resources-view .ur-search-panel,
#user-resources-view .ur-summary-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

#user-resources-view .ur-search-panel {
    padding: 0;
}

#user-resources-view .ur-search-bar {
    margin-bottom: 0;
    border: none;
    background: transparent;
}

#user-resources-view .ur-summary-panel {
    padding: 20px 24px;
}

#user-resources-view .ur-section + .ur-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

#user-resources-view .ur-section-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

#user-resources-view .ur-user-line {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

#user-resources-view .ur-agent-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

#user-resources-view .ur-server-select {
    min-width: 280px;
    max-width: 420px;
    flex: 1;
}

#user-resources-view .ur-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

#user-resources-view .ur-hint-warn {
    color: var(--warning, #d29922);
}

#user-resources-view .ur-apps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#user-resources-view .ur-app-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#user-resources-view .ur-app-card-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

#user-resources-view .ur-app-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin: 0;
    font-size: 13px;
}

#user-resources-view .ur-app-meta dt {
    display: inline;
    margin: 0;
    color: var(--text-tertiary);
    font-weight: normal;
}

#user-resources-view .ur-app-meta dt::after {
    content: '：';
}

#user-resources-view .ur-app-meta dd {
    display: inline;
    margin: 0;
    color: var(--text-secondary);
    word-break: break-all;
}

#user-resources-view .ur-empty-state,
#user-resources-view .ur-empty-inline {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 14px;
}

#user-resources-view .ur-empty-state {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

#user-resources-app-modal .ur-app-modal {
    max-width: 560px;
}

#user-resources-app-modal .ur-app-form .commerce-input,
#user-resources-app-modal .ur-server-select {
    width: 100%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

#user-resources-app-modal .ur-server-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

#user-resources-app-modal .ur-domain-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

#user-resources-app-modal .ur-domains-list {
    margin-top: 10px;
    max-width: 100%;
}

#user-resources-app-modal .ur-domains-empty {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-tertiary);
}

#user-resources-app-modal .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

@media (max-width: 720px) {
    #user-resources-view .ur-app-meta {
        grid-template-columns: 1fr;
    }

    #user-resources-view .ur-app-card {
        flex-direction: column;
    }
}

/* ===== 资源管理 ===== */

#resources-view .commerce-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

#resources-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

#resources-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#resources-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

.resource-table {
    width: 100%;
}

.resources-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.resources-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.resources-filter-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* .commerce-input 本身没有全局样式，只在 .perm-form / .resource-modal 等父级下才
   补了深色背景；筛选条在 .card 内没有这些父级，因此此处补全，保持与页面深色主题一致 */
.resources-filter-bar .commerce-input {
    width: auto;
    min-width: 140px;
    padding: 6px 10px;
    font-size: 13px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    transition: border-color var(--transition-fast);
}

.resources-filter-bar .commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.resources-filter-bar select.commerce-input {
    /* 隐藏原生下拉箭头，用 SVG 画一个浅色的，避免 Windows / 某些浏览器在深色背景上
       渲染出白底箭头 */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* 原生 <option> 在部分系统（macOS / Windows）会沿用系统默认样色；
   给 option 显式指定背景 / 前景色，确保展开列表也是深色风格。 */
.resources-filter-bar select.commerce-input option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.resources-filter-reset {
    padding: 6px 14px;
    white-space: nowrap;
}

.resources-filter-summary {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 8px 0;
}

/* 表单字段下方的灰色说明文字（字段作用 / 限制），字号比 label 小一档 */
.commerce-form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.resource-env-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(46, 200, 184, 0.15);
    color: var(--accent-primary);
    margin-right: 4px;
}

.resource-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.resource-status-online {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.resource-status-offline {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-tertiary);
}

.resource-url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    /* 自适应宽度：笔记本 ≥520，常规屏 ~80vw，超大屏封顶 1100；
       小屏走 width:90% 兜底 */
    width: 90%;
    max-width: clamp(520px, 80vw, 1100px);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s ease;
}

.resource-modal .commerce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.resource-modal .commerce-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.resource-modal .commerce-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.resource-modal .commerce-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.resource-modal .commerce-form {
    padding: 20px;
}

.resource-modal .commerce-form-group {
    margin-bottom: 16px;
}

.resource-modal .commerce-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.resource-modal .commerce-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.resource-modal .commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.resource-secret-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.resource-secret-wrap .commerce-input {
    padding-right: 36px;
}

.resource-secret-toggle {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
}

.resource-secret-toggle:hover {
    opacity: 1;
}

/* 资源表单：多行 PEM 与按钮并排；掩码用 WebKit 圆点（Chrome/Edge 等） */
.resource-secret-wrap--multiline {
    align-items: flex-start;
}

.resource-secret-wrap--multiline .commerce-input {
    flex: 1;
    min-width: 0;
}

.resource-secret-wrap--multiline .resource-secret-toggle--multiline {
    position: relative;
    right: auto;
    margin-top: 6px;
    flex-shrink: 0;
}

textarea.commerce-input.resource-textarea-secret-masked {
    -webkit-text-security: disc;
}

/* 资源多选 checkbox 组（如服务器业务） */
.resource-multi-checkbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.resource-multi-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
}

.resource-multi-checkbox-item input[type="checkbox"] {
    margin: 0;
    flex: none;
    accent-color: var(--accent-primary);
}

/* token 多 config 列表 */
.resource-token-configs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-token-config-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.resource-token-config-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.resource-token-config-item-title {
    font-weight: 500;
}

.resource-token-config-item-remove {
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    border-radius: 6px;
    cursor: pointer;
}

.resource-token-config-item-remove:hover {
    background: rgba(248, 113, 113, 0.12);
}

.resource-token-config-item-remove:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.resource-token-config-item textarea.commerce-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    min-height: 160px;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.resource-token-config-add-btn {
    width: auto;
    margin-top: 8px;
    padding: 8px 16px;
}

/* 秘钥列表：掩码 + 显示切换 */
.secret-value-cell {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.secret-val-code {
    font-size: 12px;
    word-break: break-all;
    flex: 1;
    min-width: 0;
    margin: 0;
}

.btn-secret-visibility {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    opacity: 0.65;
}

.btn-secret-visibility:hover {
    opacity: 1;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input {
    padding-right: 36px !important;
    flex: 1;
}

/* 非登录密文：用 CSS 圆点遮罩，避免 type=password 触发浏览器「保存密码」 */
.password-input-wrap input[data-masked="1"] {
    -webkit-text-security: disc;
    text-security: disc;
}

.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
}

.password-toggle-btn:hover {
    opacity: 1;
}

.password-toggle-btn:disabled {
    cursor: pointer;
    opacity: 0.6;
}

.resource-env-checkboxes {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.resource-env-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.resource-env-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.resource-modal .commerce-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}

.resource-modal .commerce-modal-footer .btn-primary,
.resource-modal .commerce-modal-footer .btn-secondary {
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.resource-extra-divider {
    padding: 12px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* 资源弹窗 —— 同一行横向布局：基础四项 / token plan 补充信息四项 */
.resource-form-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.resource-form-row > .commerce-form-group {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .resource-form-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* 细分模型列表表格 */
.resource-sub-models-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 4px;
}

.resource-sub-models-table th,
.resource-sub-models-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
    color: var(--text-primary);
}

.resource-sub-models-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
}

.resource-sub-models-table .commerce-input {
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
}

.resource-sub-models-add-btn {
    margin-top: 8px;
    width: auto;
    padding: 6px 12px;
}

.resource-sub-model-action-btn {
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

.resource-sub-model-action-btn + .resource-sub-model-action-btn {
    margin-left: 6px;
}

.resource-sub-model-action-btn:hover {
    background: var(--bg-tertiary);
}

.resource-sub-model-action-btn--danger {
    color: #d33;
}

/* 子模型 config 编辑弹窗：复用 commerce-modal 风格但层级稍高 */
.sub-model-config-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.sub-model-config-dialog {
    width: min(720px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sub-model-config-dialog h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.sub-model-config-dialog textarea {
    width: 100%;
    min-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    font-family: ui-monospace, "Menlo", "Monaco", monospace;
    font-size: 13px;
    line-height: 1.5;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.sub-model-config-dialog .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.sub-model-config-dialog .btn-primary,
.sub-model-config-dialog .btn-secondary {
    width: auto;
    padding: 6px 16px;
    font-size: 13px;
}

/* 细分模型 config 的 key 白名单提示块：弹窗里展示「凭据类」与
 * 「模型/行为类」两段；与 textarea 同宽，左侧细 border 颜色区分类别。
 * apiserver 端的真实白名单常量见 ``MODEL_ENV_PASSTHROUGH_KEYS``；
 * 任一处增删 key 后另一处必须同步更新，否则 admin 看到的提示会与后端实际接受 key 不一致。 */
.sub-model-config-keys-help {
    margin: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow: hidden;
}

.sub-model-config-keys-help__title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.sub-model-config-keys-help__section {
    padding: 10px 12px;
    border-left: 3px solid transparent;
}

.sub-model-config-keys-help__section + .sub-model-config-keys-help__section {
    border-top: 1px solid var(--border-color);
}

.sub-model-config-keys-help__section--credential {
    border-left-color: var(--accent-warning);
}

.sub-model-config-keys-help__section--passthrough {
    border-left-color: var(--accent-primary);
}

.sub-model-config-keys-help__section-title {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.sub-model-config-keys-help__group {
    margin: 0 0 8px 0;
}

.sub-model-config-keys-help__group:last-child {
    margin-bottom: 0;
}

.sub-model-config-keys-help__group-label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 2px;
    font-size: 11.5px;
}

.sub-model-config-keys-help__keys {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.sub-model-config-keys-help__keys li {
    font-family: ui-monospace, "Menlo", "Monaco", monospace;
    font-size: 11.5px;
    color: var(--text-primary);
    padding: 1px 0;
}

.resource-hint-text {
    margin: 0;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* 商品编辑弹窗内的限速资源包配置 */
.commerce-modal-bundle-section {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.commerce-modal-bundle-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.commerce-modal-bundle-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.commerce-modal-bundle-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.commerce-modal-bundle-quota-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 限速资源包整体 5h 输入：覆盖 .commerce-modal-form input[type=number] 的 100% 宽度，
   保证 label / input / 按钮三者都贴合内容并保持单行 */
.commerce-modal-form .commerce-modal-bundle-actions input[type="number"].commerce-modal-bundle-num,
.commerce-modal-bundle-actions input.commerce-modal-bundle-num {
    width: 100px;
    min-width: 80px;
    flex: 0 0 100px;
    padding: 6px 10px;
}

/* 头部允许在窄屏换行，但桌面始终两端对齐单行 */
.commerce-modal-bundle-head {
    flex-wrap: wrap;
    gap: 8px 12px;
}

.commerce-modal-bundle-actions .btn-secondary,
.commerce-modal-bundle-actions .btn-primary {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
}

.commerce-modal-bundle-hint {
    margin-bottom: 12px;
}

.commerce-modal-bundle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-primary);
}

.commerce-modal-bundle-table th,
.commerce-modal-bundle-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.commerce-modal-bundle-table th {
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-secondary);
}

.commerce-modal-bundle-num,
.commerce-modal-form input[type="number"].commerce-modal-bundle-num,
.commerce-modal-form input[type="text"].commerce-modal-bundle-num {
    width: 80px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

.commerce-modal-bundle-remove {
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    border-radius: 6px;
    cursor: pointer;
}

.commerce-modal-bundle-remove:hover {
    background: rgba(248, 113, 113, 0.12);
}

.commerce-modal-readonly-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

#admin-product-key[readonly] {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 资源选择弹层（添加 token 资源到限速包） */
.commerce-modal-bundle-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.commerce-modal-bundle-picker {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 540px;
    color: var(--text-primary);
}

.commerce-modal-bundle-picker p {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.commerce-modal-bundle-picker select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.commerce-modal-bundle-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.commerce-modal-bundle-picker-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commerce-modal-bundle-picker .btn-secondary,
.commerce-modal-bundle-picker .btn-primary {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
}

/* 添加应用选择弹窗 */
.add-app-choice .choice-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-app-choice .choice-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    flex-wrap: wrap;
}

.add-app-choice .choice-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.add-app-choice .choice-option input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.add-app-choice .choice-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.add-app-choice .choice-recommend-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    vertical-align: middle;
}

.add-app-choice .choice-desc {
    width: 100%;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 24px;
}

.add-app-choice .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.add-app-choice .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.add-app-choice .checkbox-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    flex: none;
}

.add-app-choice .checkbox-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.add-app-choice .checkbox-option input[type="checkbox"] {
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* 模板单选样式（与 checkbox 视觉对齐） */
.add-app-choice .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.add-app-choice .radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    flex: none;
}

.add-app-choice .radio-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.add-app-choice .radio-option input[type="radio"] {
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ===== 应用配置向导 Wizard ===== */

/* 向导顶部流程条 */
.wizard-flow-bar {
    display: flex;
    align-items: center;
    padding: 16px 24px 0;
    overflow-x: auto;
    flex-shrink: 0;
    gap: 0;
}

.wizard-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.wizard-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-step-node.active .wizard-step-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.2);
}

.wizard-step-node.done .wizard-step-dot {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.wizard-step-node.done .wizard-step-dot::after {
    content: '✓';
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.wizard-step-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: center;
    transition: var(--transition);
}

.wizard-step-node.active .wizard-step-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.wizard-step-node.done .wizard-step-label {
    color: var(--accent-success);
}

.wizard-step-connector {
    flex: 1;
    min-width: 20px;
    height: 2px;
    background: var(--border-color);
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* 向导内容区域 */
.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.wizard-step-panel {
    display: none;
}

.wizard-step-panel.active {
    display: block;
}

/* 向导底部操作栏 */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.wizard-footer-left {
    display: flex;
    gap: 8px;
}

.wizard-footer-right {
    display: flex;
    gap: 8px;
}

/* 完成按钮 */
.btn-success {
    padding: 8px 20px;
    background: var(--accent-success);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-success:hover {
    opacity: 0.85;
}

/* ===== 部署配置 ===== */

.deploy-card {
    margin-bottom: 16px;
    padding: 16px 20px;
}

.deploy-card .form-group {
    margin-bottom: 14px;
}

.deploy-card .form-group:last-child {
    margin-bottom: 0;
}

.deploy-official-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.deploy-official-row-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex: none;
}

.deploy-official-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.deploy-official-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-tertiary, #f5f5f5);
    transition: background 0.15s;
}

.deploy-official-label:hover {
    background: var(--bg-secondary, #eaeaea);
}

.deploy-official-label input[type="checkbox"] {
    margin: 0;
    accent-color: var(--accent-primary, #2EC8B8);
}

.deploy-uuid-badge {
    display: inline-block;
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    margin-left: 8px;
}

.deploy-custom-input {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

/* 部署预览模态框 */
.modal-container {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
}

/* ===== 反馈渠道（admin 管理页） ===== */

#feedback-channels-view .commerce-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

#feedback-channels-view .commerce-page-head-text {
    min-width: 0;
}

#feedback-channels-view .commerce-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

#feedback-channels-view .commerce-page-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

#feedback-channels-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

#feedback-channels-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#feedback-channels-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

.feedback-channel-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    max-width: 520px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s ease;
}

.feedback-channel-modal .commerce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.feedback-channel-modal .commerce-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-channel-modal .commerce-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.feedback-channel-modal .commerce-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.feedback-channel-modal .commerce-form {
    padding: 20px;
}

.feedback-channel-modal .commerce-form-group {
    margin-bottom: 16px;
}

.feedback-channel-modal .commerce-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.feedback-channel-modal .commerce-label .required {
    color: var(--accent-danger);
}

.feedback-channel-modal .commerce-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.feedback-channel-modal .commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.feedback-channel-modal .commerce-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}

.feedback-channel-modal .commerce-modal-footer .btn-primary,
.feedback-channel-modal .commerce-modal-footer .btn-secondary {
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.feedback-qr-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.feedback-qr-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.feedback-qr-url-input {
    margin-top: 4px;
}

.feedback-qr-preview-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 8px;
}

.feedback-qr-preview-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.feedback-qr-clear-btn {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
}

.feedback-form-tip {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0 0;
}

.feedback-channel-qr-cell img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.feedback-channel-link-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 人工客服页面（普通用户） ===== */

.user-feedback-list {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-page-loading,
.feedback-page-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 48px 0;
    font-size: 14px;
}

.feedback-channel-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
}

.feedback-channel-card-info {
    flex: 1;
    min-width: 0;
}

.feedback-channel-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feedback-channel-card-link a {
    color: var(--accent-primary, #2EC8B8);
    font-size: 14px;
    word-break: break-all;
}

.feedback-channel-card-qr img {
    width: 240px;
    height: 240px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    flex: none;
}

@media (max-width: 768px) {
    .feedback-channel-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .feedback-channel-card-qr {
        display: flex;
        justify-content: center;
    }

    .feedback-channel-card-qr img {
        width: min(240px, 80vw);
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* ===== Responsive: Hamburger Toggle & Overlay ===== */
.sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 99;
}

/* ===== Responsive: wide screens — proportionally distribute column widths =====
   On large monitors each fixed-px column would stay tiny while the auto title
   column ate all extra space. Switching to percentages lets every column scale
   with the viewport so the table fills the area evenly. The breakpoint is set
   to 1700px so laptop/normal-desktop widths (≤1680px) keep the existing px-tuned
   column widths — at lower viewport sizes the percentages would shrink the
   action/links columns below the threshold needed for the buttons to fit on a
   single row. */
@media (min-width: 1700px) {
    .tasks-table .task-col-id {
        width: 5%;
    }

    .tasks-table .task-col-status {
        width: 11%;
    }

    .tasks-table .task-col-app {
        width: 13%;
    }

    .tasks-table .task-col-created {
        width: 14%;
    }

    .tasks-table .task-col-actions {
        width: 17%;
    }

    .apps-table .app-col-id {
        width: 6%;
    }

    .apps-table .app-col-status {
        width: 10%;
    }

    .apps-table .app-col-links {
        width: 11%;
    }

    .apps-table .app-col-created {
        width: 13%;
    }

    .apps-table .app-col-actions {
        width: 15%;
    }
}

/* ===== Responsive: medium screens (laptop / small desktop) ===== */
@media (max-width: 1280px) {
    .main-content {
        padding: 20px;
    }

    /* Tighten fixed columns on laptops; title still absorbs the remainder and ellipses */
    .tasks-table .task-col-id {
        width: 64px;
    }

    .tasks-table .task-col-status {
        width: 120px;
    }

    .tasks-table .task-col-app {
        width: 130px;
    }

    .tasks-table .task-col-created {
        width: 150px;
    }

    .tasks-table .task-col-actions {
        width: 210px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 12px;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }

    .main-content {
        padding: 16px;
    }

    .view-header h2 {
        font-size: 20px;
    }

    .tasks-table .task-col-id {
        width: 56px;
    }

    .tasks-table .task-col-status {
        width: 110px;
    }

    .tasks-table .task-col-app {
        width: 110px;
    }

    .tasks-table .task-col-created {
        width: 140px;
    }

    .tasks-table .task-col-actions {
        width: 200px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 10px;
    }

    /* Allow wide tables to scroll horizontally inside their container instead of pushing the page wider */
    .config-section,
    .apps-table-wrap,
    .tasks-table-wrap,
    .task-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Responsive: Auth split layout ===== */
@media (max-width: 1100px) {
    .auth-brand {
        padding: 44px 36px;
    }

    .brand-headline {
        font-size: 32px;
    }

    .brand-features {
        display: none;
    }
}

@media (max-width: 900px) {
    .auth-layout {
        flex-direction: column;
        min-height: 100vh;
        overflow-y: auto;
    }

    .auth-brand {
        flex: none;
        min-height: auto;
        padding: 30px 24px 24px;
        text-align: center;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    }

    .auth-brand-content {
        max-width: 620px;
        margin: 0 auto;
    }

    .brand-logo {
        justify-content: center;
        margin-bottom: 14px;
    }

    .brand-logo .logo-icon {
        width: 54px;
        height: 54px;
    }

    .brand-logo-text strong {
        font-size: 30px;
    }

    .brand-kicker {
        margin-bottom: 10px;
    }

    .brand-headline {
        max-width: 560px;
        font-size: 28px;
        line-height: 1.22;
        margin: 0 auto 10px;
    }

    .brand-sub {
        max-width: 560px;
        font-size: 14px;
        margin-bottom: 0;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.7;
    }

    .auth-panel {
        flex: 1 1 auto;
        padding: 28px 16px 40px;
    }
}

/* ===== Responsive: extra-small screens (small phones) ===== */
@media (max-width: 480px) {
    .auth-brand {
        min-height: 180px;
        padding: 26px 18px 18px;
    }

    .brand-logo {
        flex-direction: column;
        gap: 8px;
    }

    .brand-logo-text {
        justify-items: center;
    }

    .brand-logo-text strong {
        font-size: 28px;
    }

    .brand-headline {
        font-size: 24px;
    }

    .auth-card {
        padding: 20px;
    }

    .view-header h2 {
        font-size: 18px;
    }

    .modal {
        width: 95vw;
        max-width: 95vw;
        max-height: 90vh;
    }

    /* 移动端下让 .modal-wide / .modal-share-blog 也回到 95vw，避免被 clamp 的 min 值卡住超出视口 */
    .modal.modal-wide,
    .modal.modal-share-blog {
        width: 95vw;
        max-width: 95vw;
    }

    .btn-primary,
    .btn-secondary,
    .btn-action {
        font-size: 13px;
    }
}

/* Lock background scroll while the off-canvas sidebar is open */
body.sidebar-open {
    overflow: hidden;
}


/* ===== 模型管理（admin） ===== */
/* "+ 新增模型" 按钮风格与资源管理一致：透明背景 + 主题色描边 */
#models-view .commerce-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

#models-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

#models-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#models-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

/* 模型新增/编辑弹窗：与资源弹窗保持一致的卡片 + 表单风格 */
.model-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s ease;
}

.model-modal .commerce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.model-modal .commerce-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-modal .commerce-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.model-modal .commerce-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.model-modal .commerce-form {
    padding: 20px;
}

.model-modal .commerce-form-group {
    margin-bottom: 16px;
}

.model-modal .commerce-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.model-modal .commerce-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.model-modal .commerce-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.15);
}

.model-modal .commerce-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}

.model-modal .commerce-modal-footer .btn-primary,
.model-modal .commerce-modal-footer .btn-secondary {
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.model-modal .resource-hint-text {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.model-modal .required {
    color: var(--accent-danger, #f85149);
    margin-left: 2px;
}

/* ===== AI 推荐开源项目：列表渲染（chat agent reply 内联） ===== */
.oss-rec-table {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary, #fff);
    font-size: 13px;
}

.oss-rec-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr 2fr 88px 88px;
    gap: 12px;
    padding: 12px 14px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.5;
}

.oss-rec-row:last-child {
    border-bottom: none;
}

.oss-rec-head {
    font-weight: 600;
    background: var(--bg-tertiary, #f7f8fa);
    color: var(--text-primary);
}

.oss-rec-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.oss-rec-summary,
.oss-rec-reason {
    color: var(--text-secondary, var(--text-primary));
    word-break: break-word;
}

.oss-rec-reason {
    color: var(--text-tertiary, #6a7280);
}

.oss-rec-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 12px;
}

.oss-rec-link:hover {
    text-decoration: underline;
}

.oss-rec-link-disabled {
    color: var(--text-muted, #9ca3af);
    font-size: 12px;
}

.oss-rec-deploy-btn {
    width: auto;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    transition: var(--transition, all 0.2s);
}

.oss-rec-deploy-btn:hover:not(:disabled) {
    filter: brightness(0.95);
}

.oss-rec-deploy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oss-rec-risk {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(248, 81, 73, 0.12);
    color: var(--accent-danger, #f85149);
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.5;
    word-break: break-word;
}

@media (max-width: 768px) {
    .oss-rec-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .oss-rec-head {
        display: none;
    }
    .oss-rec-name::before { content: '名称：'; color: var(--text-muted); font-weight: normal; }
    .oss-rec-summary::before { content: '简介：'; color: var(--text-muted); }
    .oss-rec-reason::before { content: '推荐理由：'; color: var(--text-muted); }
}

/* ===== Gift tab bar (gifts-view 子 tab) ===== */
.gift-tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin: 0 0 16px;
    padding: 0;
}
.gift-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}
.gift-tab-btn:hover { color: var(--text-primary); }
.gift-tab-btn.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}
.gift-tab-panel { display: block; }
.gift-tab-panel[hidden] { display: none; }

/* ===== Agent 交互卡片 ===== */
.ui-card-list,
.sc-ui-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.ui-card,
.sc-ui-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary, #fff);
    padding: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.ui-card.is-submitted,
.sc-ui-card.is-submitted {
    border-color: rgba(34, 197, 94, 0.45);
}

.ui-card-title,
.sc-ui-card-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ui-card-desc,
.sc-ui-card-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.ui-card-questions,
.sc-ui-card-questions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ui-card-question {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ui-card-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.ui-card-required {
    color: var(--accent-danger, #f85149);
    margin-left: 2px;
}

.ui-card-help {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ui-card-answer {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ui-card-danger,
.sc-ui-card-danger {
    color: var(--accent-danger, #f85149);
    font-size: 12px;
    line-height: 1.5;
}

.ui-card-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    font-size: 13px;
}

textarea.ui-card-input {
    min-height: 76px;
    resize: vertical;
}

.ui-card-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.ui-card-bool {
    color: var(--text-secondary);
    font-size: 13px;
}

.ui-card-actions,
.sc-ui-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.ui-card-submit,
.sc-ui-card-submit {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.ui-card-submit:disabled,
.sc-ui-card-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 商品兑换码列表 ===== */
.redeem-codes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.redeem-codes-hint {
    color: var(--text-muted);
    font-size: 12px;
}
.redeem-codes-table th, .redeem-codes-table td {
    white-space: nowrap;
}

/* 商店按钮组 */
.store-product-actions .store-redeem-btn {
    padding: 6px 14px;
    font-size: 13px;
}

/* ===== 商品兑换码（gifts-view 子 tab）样式 ===== */
/* 复用 #products-view / #orders-view 的 commerce-* 样式，扩展到 #gifts-view */

#gifts-view .commerce-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
}

#gifts-view .commerce-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#gifts-view .commerce-table thead th {
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
}

#gifts-view .commerce-table tbody td {
    padding: 10px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

#gifts-view .commerce-table tbody tr {
    transition: var(--transition);
}

#gifts-view .commerce-table tbody tr:hover {
    background: rgba(46, 200, 184, 0.04);
}

#gifts-view .commerce-table tbody tr:last-child td {
    border-bottom: none;
}

#gifts-view .commerce-code {
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

#gifts-view .commerce-empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 10px !important;
    white-space: normal;
}

#gifts-view .commerce-muted {
    color: var(--text-muted);
    font-size: 12px;
}

#gifts-view .commerce-add-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid rgba(46, 200, 184, 0.45);
    box-shadow: none;
    transition: var(--transition);
}

#gifts-view .commerce-add-product-btn:hover {
    background: rgba(46, 200, 184, 0.1);
    border-color: var(--accent-primary);
}

#gifts-view .commerce-add-icon {
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    opacity: 0.9;
}

#gifts-view .redeem-codes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#gifts-view .redeem-codes-hint {
    color: var(--text-muted);
    font-size: 12px;
}

#gifts-view .commerce-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

#gifts-view .commerce-page-info {
    color: var(--text-muted);
    font-size: 12px;
}

#gifts-view .commerce-offline-btn {
    background: transparent;
    border: 1px solid rgba(248, 81, 73, 0.45);
    color: var(--accent-danger);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

#gifts-view .commerce-offline-btn:hover {
    background: rgba(248, 81, 73, 0.1);
}

/* ========== 业务总览（admin 默认首页） ========== */
#business-overview-view {
    color: var(--text-primary);
}

/* 页头 */
.bo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.6);
}
.bo-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bo-kicker {
    font-size: 11px;
    letter-spacing: 0.22em;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
}
.bo-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #e6edf3 0%, #8b949e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}
.bo-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.bo-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bo-window-pill {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(46, 200, 184, 0.25);
    background: rgba(46, 200, 184, 0.08);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.bo-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bo-refresh-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.08);
    color: var(--accent-primary);
}
.bo-refresh-btn:active .bo-refresh-icon {
    transform: rotate(-180deg);
}
.bo-refresh-icon {
    display: inline-block;
    transition: transform 0.4s ease;
    font-size: 14px;
}

/* 错误条 */
.bo-error {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--accent-danger);
    font-size: 13px;
}

/* 总览卡片 */
.bo-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.bo-stat-card {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 22px 20px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(28, 33, 40, 0.95) 0%, rgba(22, 27, 34, 0.95) 100%);
    border: 1px solid rgba(48, 54, 61, 0.8);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.bo-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bo-accent, #2EC8B8);
    opacity: 0.9;
}
.bo-stat-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bo-accent, #2EC8B8) 0%, transparent 70%);
    opacity: 0.12;
    pointer-events: none;
}
.bo-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--bo-accent, #2EC8B8);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.bo-stat-card--users { --bo-accent: #2EC8B8; }
.bo-stat-card--apps { --bo-accent: #3fb950; }
.bo-stat-card--chats { --bo-accent: #d29922; }
.bo-stat-card--revenue { --bo-accent: #C77B2B; }

.bo-stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.bo-stat-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bo-stat-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.bo-stat-hint {
    color: var(--text-muted);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(139, 148, 158, 0.1);
    font-weight: 400;
}
.bo-stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.bo-stat-foot {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* 图表面板 */
.bo-chart-panel {
    background: linear-gradient(180deg, rgba(28, 33, 40, 0.85) 0%, rgba(22, 27, 34, 0.9) 100%);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 14px;
    padding: 22px 24px 18px;
    margin-bottom: 22px;
}
.bo-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.bo-chart-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
.bo-chart-sub {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.bo-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bo-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
}
.bo-legend-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #e6edf3);
}
.bo-legend-chip:focus-visible {
    outline: 2px solid rgba(46, 200, 184, 0.6);
    outline-offset: 2px;
}
.bo-legend-chip--hidden {
    opacity: 0.45;
    text-decoration: line-through;
}
.bo-legend-chip--hidden .bo-legend-dot {
    opacity: 0.5;
    box-shadow: none;
}
.bo-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
    transition: opacity 0.15s ease;
}
.bo-chart-wrap {
    position: relative;
    height: 280px;
}
.bo-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
.bo-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    background: rgba(13, 17, 23, 0.4);
    border-radius: 10px;
}

@media (max-width: 640px) {
    .bo-header { flex-direction: column; align-items: flex-start; }
    .bo-title { font-size: 22px; }
    .bo-stat-value { font-size: 24px; }
    .bo-chart-wrap { height: 220px; }
}

/* ===== Chat Execution Events ===== */
.msg-event-panel {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(46, 200, 184, 0.18);
    border-radius: 10px;
    background: rgba(46, 200, 184, 0.06);
}

.msg-event-panel.is-collapsed {
    padding: 8px 10px;
}

.msg-event-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.msg-event-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.msg-event-summary {
    color: var(--text-muted);
    font-size: 12px;
}

.msg-event-toggle {
    padding: 2px 8px;
    border: 1px solid rgba(46, 200, 184, 0.24);
    border-radius: 999px;
    color: var(--accent-primary);
    background: rgba(46, 200, 184, 0.08);
    font-size: 12px;
}

.msg-event-toggle:hover {
    background: rgba(46, 200, 184, 0.14);
}

.msg-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.msg-event-empty {
    color: var(--text-muted);
    font-size: 12px;
}

.msg-event-node {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: var(--event-indent, 0);
}

.msg-event-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
    flex: none;
}

.msg-event-node.success .msg-event-dot {
    background: var(--accent-success);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.12);
}

.msg-event-node.failed .msg-event-dot {
    background: var(--accent-danger);
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.12);
}

.msg-event-node.skipped .msg-event-dot,
.msg-event-node.info .msg-event-dot {
    background: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(139, 148, 158, 0.12);
}

.msg-event-main {
    min-width: 0;
    flex: 1;
}

.msg-event-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 22px;
}

.msg-event-name {
    color: var(--text-primary);
    font-size: 13px;
}

.msg-event-progress {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(46, 200, 184, 0.12);
    color: var(--accent-primary);
    font-size: 11px;
    white-space: nowrap;
}

.msg-event-time {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.msg-event-progress.success {
    background: rgba(63, 185, 80, 0.12);
    color: var(--accent-success);
}

.msg-event-progress.failed {
    background: rgba(248, 81, 73, 0.12);
    color: var(--accent-danger);
}

.msg-event-progress.skipped,
.msg-event-progress.info {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-secondary);
}

.msg-event-desc {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.msg-event-children {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

/* ===== 用户自定义 skill / MCP 资产页 ===== */

.agent-assets-intro {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 24px 0;
    max-width: 900px;
}
.agent-assets-intro strong {
    color: var(--text-primary);
    font-weight: 600;
}

.agent-assets-import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.agent-assets-import-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agent-assets-import-card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}
.agent-assets-import-card-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}
.agent-assets-import-card code {
    background: var(--bg-tertiary, rgba(0,0,0,0.05));
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.agent-asset-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.agent-asset-zip-filename {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
    word-break: break-all;
}

/* MCP 脚本文件列表（可查看 / 下载 / 替换 / 删除） */
.agent-asset-script-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}
.agent-asset-script-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-secondary, #f5f5f7);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
}
.agent-asset-script-name {
    flex: 1;
    color: var(--text-primary);
    word-break: break-all;
}
.agent-asset-script-chip .btn-link {
    flex: none;
}
.agent-asset-script-delete {
    color: var(--danger-color, #dc3545);
}
.agent-asset-script-pre {
    margin: 0;
    max-height: 60vh;
    overflow: auto;
    padding: 12px;
    background: var(--bg-secondary, #f5f5f7);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre;
    word-break: normal;
}
/* 查看器叠在 MCP 弹窗（9999）之上 */
.agent-asset-script-viewer-overlay {
    z-index: 10001;
}

.agent-assets-list-section {
    margin-top: 8px;
}
.agent-assets-list-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.agent-assets-list-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}
.agent-assets-list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.agent-asset-ops {
    white-space: nowrap;
}
.agent-asset-ops .btn-link {
    margin-right: 10px;
}
.agent-asset-desc-cell {
    color: var(--text-secondary);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-asset-badge {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--bg-secondary, #f0f0f5);
    color: var(--text-secondary);
    margin-left: 4px;
}
.agent-asset-hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-secondary, #f7f7fa);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 4px;
}
.agent-asset-hint code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 4px;
}
.agent-asset-pre {
    margin: 6px 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}
.agent-skill-method-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}
.agent-skill-method-tabs label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.agent-skill-method-tabs label:hover {
    border-color: var(--accent-color, #ef4444);
    color: var(--text-primary);
}
.agent-skill-method-tabs input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.agent-skill-method-tabs label:has(input[type="radio"]:checked) {
    border-color: var(--accent-color, #ef4444);
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-primary);
    font-weight: 600;
}
.agent-skill-method-tabs label:has(input[type="radio"]:focus-visible) {
    outline: 2px solid var(--accent-color, #ef4444);
    outline-offset: 2px;
}

.agent-asset-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
    max-width: 360px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.4;
}
.badge-skill {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}
.badge-mcp {
    background: rgba(168, 85, 247, 0.12);
    color: #7e22ce;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 999px;
    transition: 0.2s;
}
.switch-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .switch-slider {
    background-color: #22c55e;
}
.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-color, #ef4444);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}
.btn-link:hover {
    text-decoration: underline;
}
.loading-cell {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ----- 粘贴对话框 ----- */
.agent-asset-paste-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.agent-asset-paste-modal-card {
    max-width: 640px !important;
    width: 100%;
    /* 遮罩上下各 16px padding */
    max-height: calc(100vh - 32px);
}

/* 卡片本身是 overflow:hidden（见主题层的 .modal 规则），滚动交给 body，
   footer 里的按钮才不会在矮屏上被裁掉 */
.agent-asset-paste-modal-card .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.agent-asset-paste-modal-card .modal-footer {
    flex: none;
}
.agent-asset-paste-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.agent-asset-paste-field label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.agent-asset-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.agent-mcp-format-json-btn {
    flex: none;
    font-size: 12px;
}
.agent-asset-paste-field input,
.agent-asset-paste-field select,
.agent-asset-paste-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}
.agent-asset-paste-field textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 200px;
}

.agent-asset-paste-modal-card .modal-body {
    padding: 16px 24px;
}
.agent-asset-paste-modal-card .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===== Quodara AI 全局界面覆盖 ===== */
:root {
    color-scheme: light;
}

.view-header h2,
.commerce-page-title,
.profile-section-title,
.config-section-title,
.sc-welcome-title,
.deploy-page-title {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.view-header h2::after,
.commerce-page-title::after,
.profile-section-title::after,
.config-section-title::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--ase-gradient);
}

.table-container,
.apps-card-container,
.todo-container,
.config-section,
.wizard-body,
.wizard-sidebar,
.profile-user-card,
.profile-section,
.profile-action-card,
.profile-service-card,
.store-product-card,
.okr-objective-block,
.commerce-panel,
.commerce-card,
.commerce-table-wrap,
.resource-card,
.model-card,
.modal,
.modal-container,
.md-preview-card,
.sc-mr-modal-card,
.deploy-table-wrap,
.sc-sidebar,
.sc-detail-topbar,
.sc-welcome-composer,
.sc-detail-composer-box,
.chat-sidebar,
.chat-main {
    background: rgba(21, 24, 23, 0.88);
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.modal,
.modal-container,
.md-preview-card,
.sc-mr-modal-card,
.agent-asset-paste-modal-card {
    position: relative;
    overflow: hidden;
}

.modal::before,
.modal-container::before,
.md-preview-card::before,
.sc-mr-modal-card::before,
.agent-asset-paste-modal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--ase-gradient);
}

.modal-header,
.modal-body,
.modal-content,
.modal-footer,
.agent-asset-paste-modal-card .modal-body,
.agent-asset-paste-modal-card .modal-footer {
    position: relative;
    z-index: 1;
}

.btn-primary,
.btn-google,
.sc-send-btn,
.sc-detail-send-btn,
.sc-new-btn,
.store-redeem-btn,
.commerce-add-product-btn,
.okr-add-btn,
.wizard-step-node.active .wizard-step-dot,
.wizard-step-node.done .wizard-step-dot {
    background: var(--ase-gradient);
    color: #07110f;
    border-color: rgba(46, 200, 184, 0.42);
}

.btn-secondary,
.btn-back,
.btn-action,
.filter-btn,
.sidebar-recent-load-more-btn,
.sc-attach-btn,
.sc-detail-merge-btn,
.sc-support-ticket-btn,
.commerce-btn-upload,
.wizard-env-tab,
.wizard-sidebar-tab,
.apps-tab-btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
    border-radius: 8px;
}

.btn-secondary:hover,
.btn-back:hover,
.btn-action:hover,
.filter-btn:hover,
.sidebar-recent-load-more-btn:hover:not(:disabled),
.sc-attach-btn:hover,
.sc-detail-merge-btn:hover,
.sc-support-ticket-btn:hover,
.commerce-btn-upload:hover,
.wizard-env-tab:hover,
.wizard-sidebar-tab:hover,
.profile-action-card:hover,
.store-product-card:hover {
    border-color: rgba(46, 200, 184, 0.38);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(46, 200, 184, 0.10);
}

.apps-tab-btn.active,
.wizard-sidebar-tab.active,
.wizard-env-tab.active,
.sidebar-recent-tab.active,
.filter-btn.checked {
    background: rgba(46, 200, 184, 0.14);
    border-color: rgba(46, 200, 184, 0.38);
    color: var(--accent-primary);
}

.form-input,
.search-input,
.modal-content select,
.profile-preferences-field select,
.agent-asset-paste-field input,
.agent-asset-paste-field select,
.agent-asset-paste-field textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="email"],
select,
textarea {
    background: rgba(13, 15, 14, 0.82);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-input:focus,
.search-input:focus,
.modal-content select:focus,
.profile-preferences-field select:focus,
.agent-asset-paste-field input:focus,
.agent-asset-paste-field select:focus,
.agent-asset-paste-field textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.14);
}

.data-table th,
.deploy-table th,
.commerce-table th {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-secondary);
}

.data-table tbody tr:hover,
.deploy-table tbody tr:hover,
.commerce-table tbody tr:hover {
    background: rgba(46, 200, 184, 0.055);
}

.status-badge,
.app-visibility-badge,
.app-card-id,
.sidebar-recent-status,
.sc-detail-topbar-badge,
.store-product-price {
    border-radius: 6px;
}

.app-card-thumbnail-shell,
.app-card-preview-default-icon,
.store-product-icon,
.profile-action-icon,
.empty-icon {
    background:
        linear-gradient(135deg, rgba(46, 200, 184, 0.16), rgba(77, 120, 216, 0.14) 58%, rgba(199, 123, 43, 0.12)),
        rgba(255, 255, 255, 0.045);
    color: var(--accent-primary);
}

.switch input:checked + .switch-slider {
    background: var(--ase-gradient);
}

/* ===== Manus palette (sampled from manus.im/app) =====
   sidebar #f0f0f0 | main #f8f8f6 | elevated #ffffff | mute #a3a3a3 */
:root {
    color-scheme: light;
}

body {
    background: var(--bg-primary);
}

.logo-icon {
    filter: none;
}

.auth-layout {
    background: #f8f8f6;
    --ase-bg: #f8f8f6;
    --ase-bg-soft: #f0f0f0;
    --ase-panel: #ffffff;
    --ase-panel-soft: #f5f5f3;
    --ase-cyan: #5eb8c9;
    --ase-blue: #3b82f6;
    --ase-amber: #d4923a;
    --ase-green: #22a06b;
    --ase-line: rgba(0, 0, 0, 0.06);
    --ase-grad: linear-gradient(180deg, #4b8ef7 0%, #3b82f6 100%);
}

.auth-layout::before {
    background-image: none;
    opacity: 0;
}

.auth-brand {
    background: #f0f0f0;
    color: #2c2c2c;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-grid {
    background-image: none;
    opacity: 0;
}

.brand-shape-1 {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.02));
}

.brand-shape-2 {
    border-color: rgba(0, 0, 0, 0.08);
}

.brand-shape-3 {
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.08) 45%, rgba(59, 130, 246, 0.25) 100%);
}

.brand-logo .logo-icon {
    width: 52px;
    height: 52px;
    filter: none;
}

.brand-logo-text strong {
    color: #2c2c2c;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(23px, 2.4vw, 30px);
    letter-spacing: -0.02em;
    font-weight: 600;
}

.brand-logo-text em,
.brand-sub,
.brand-features li span:not(.brand-feature-icon) {
    color: #6b6b6b;
}

.brand-kicker {
    color: #8a8a8a;
}

.brand-headline,
.brand-features li strong {
    color: #2c2c2c;
}

.brand-features li {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.brand-features li:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.brand-feature-icon {
    color: #ffffff;
    background: #3b82f6;
}

.brand-feature-icon::after {
    background: rgba(59, 130, 246, 0.15);
}

.auth-panel {
    background: #f8f8f6;
}

.auth-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.auth-card::before {
    height: 0;
}

.auth-card-brand {
    margin-bottom: 22px;
}

.auth-card-brand .logo-icon {
    width: 34px;
    height: 34px;
}

.auth-card-brand strong {
    color: #2c2c2c;
}

.auth-card-brand span {
    color: #8a8a8a;
}

.auth-tabs {
    background: #f0f0f0;
    border-color: transparent;
}

.tab-btn {
    color: #8a8a8a;
}

.tab-btn:hover {
    color: #2c2c2c;
}

.tab-btn.active,
.auth-form .btn-primary,
.btn-primary,
.btn-google,
.sc-send-btn,
.sc-detail-send-btn,
.sc-new-btn,
.store-redeem-btn,
.commerce-add-product-btn,
.okr-add-btn,
.wizard-step-node.active .wizard-step-dot,
.wizard-step-node.done .wizard-step-dot {
    background: #3b82f6;
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.auth-form .btn-primary:hover,
.btn-primary:hover,
.btn-google:hover,
.sc-send-btn:hover,
.sc-detail-send-btn:hover,
.sc-new-btn:hover {
    background: #4b8ef7;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.24);
}

.form-group label {
    color: #4a4a4a;
    font-weight: 500;
}

.form-group input,
.form-input,
.search-input,
.modal-content select,
.profile-preferences-field select,
.agent-asset-paste-field input,
.agent-asset-paste-field select,
.agent-asset-paste-field textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="email"],
select,
textarea {
    background: #f5f5f3;
    border-color: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
}

.form-group input::placeholder,
.form-input::placeholder,
.search-input::placeholder,
textarea::placeholder {
    color: #a3a3a3;
}

.form-group input:focus,
.form-input:focus,
.search-input:focus,
.modal-content select:focus,
.profile-preferences-field select:focus,
.agent-asset-paste-field input:focus,
.agent-asset-paste-field select:focus,
.agent-asset-paste-field textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}

select.form-input option {
    background: #ffffff;
    color: #2c2c2c;
}

.message.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.message.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.sidebar {
    background: #f0f0f0;
    border-right-color: transparent;
    box-shadow: none;
}

.sidebar-header {
    border-bottom-color: transparent;
}

.sidebar-header .logo-icon {
    width: 30px;
    height: 30px;
}

.sidebar-header .logo-text {
    color: #2c2c2c;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.sidebar-recent-chats {
    border-top-color: rgba(0, 0, 0, 0.05);
}

.nav-item,
.sidebar-recent-item {
    color: #6b6b6b;
    border-radius: 10px;
    border-color: transparent;
}

.nav-item:hover,
.sidebar-recent-item:hover {
    background: #e7e7e5;
    border-color: transparent;
    color: #2c2c2c;
}

.nav-item.active,
.sidebar-recent-item.active,
.sidebar-recent-tab.active,
.filter-btn.checked,
.apps-tab-btn.active,
.wizard-sidebar-tab.active,
.wizard-env-tab.active {
    background: #e7e7e5;
    border-color: transparent;
    color: #2c2c2c;
}

.nav-icon {
    background: transparent;
    color: #8a8a8a;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    color: #2c2c2c;
    background: transparent;
}

.sidebar-user-panel,
.sidebar-recent-load-more-btn,
.btn-logout {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.sidebar-user-panel-clickable:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.main-content {
    background: #f8f8f6;
}

.view-header h2,
.commerce-page-title,
.profile-section-title,
.config-section-title,
.sc-welcome-title,
.deploy-page-title {
    color: #2c2c2c;
    font-weight: 500;
}

.table-container,
.apps-card-container,
.todo-container,
.config-section,
.wizard-body,
.wizard-sidebar,
.profile-user-card,
.profile-section,
.profile-action-card,
.profile-service-card,
.store-product-card,
.okr-objective-block,
.commerce-panel,
.commerce-card,
.commerce-table-wrap,
.resource-card,
.model-card,
.modal,
.modal-container,
.md-preview-card,
.sc-mr-modal-card,
.deploy-table-wrap,
.sc-sidebar,
.sc-detail-topbar,
.chat-sidebar,
.chat-main {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border-radius: 14px;
}

.sc-welcome-composer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sc-composer-box,
.sc-detail-composer-box {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05) !important;
}

.modal::before,
.modal-container::before,
.md-preview-card::before,
.sc-mr-modal-card::before,
.agent-asset-paste-modal-card::before {
    height: 0;
    background: transparent;
}

.btn-secondary,
.btn-back,
.btn-action,
.filter-btn,
.sc-attach-btn,
.sc-detail-merge-btn,
.sc-support-ticket-btn,
.commerce-btn-upload,
.wizard-env-tab,
.wizard-sidebar-tab,
.apps-tab-btn {
    border-color: rgba(0, 0, 0, 0.06);
    background: #ffffff;
    color: #6b6b6b;
    border-radius: 10px;
}

.btn-secondary:hover,
.btn-back:hover,
.btn-action:hover,
.filter-btn:hover,
.sidebar-recent-load-more-btn:hover:not(:disabled),
.sc-attach-btn:hover,
.sc-detail-merge-btn:hover,
.sc-support-ticket-btn:hover,
.commerce-btn-upload:hover,
.wizard-env-tab:hover,
.wizard-sidebar-tab:hover,
.profile-action-card:hover,
.store-product-card:hover {
    border-color: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
    box-shadow: none;
    background: #f0f0f0;
}

.data-table th,
.deploy-table th,
.commerce-table th {
    background: #f5f5f3;
    color: #8a8a8a;
}

.data-table tbody tr:hover,
.deploy-table tbody tr:hover,
.commerce-table tbody tr:hover {
    background: #f5f5f3;
}

.app-card-thumbnail-shell,
.app-card-preview-default-icon,
.store-product-icon,
.profile-action-icon,
.empty-icon {
    background: #f0f0f0;
    color: #6b6b6b;
}

.switch input:checked + .switch-slider {
    background: #22a06b;
}

.chats-split-view,
.chat-page {
    background: #f8f8f6 !important;
}

.chat-sidebar,
.sc-sidebar {
    background: #f0f0f0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.chat-main,
.sc-main {
    background: #f8f8f6 !important;
}

.sc-detail-topbar,
.msg-agent-row {
    background: #f8f8f6 !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.chat-input-container,
.input-container {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05) !important;
    border-radius: 24px !important;
}

.new-chat-btn,
.sidebar-action-btn,
.gitpush-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
}

.new-chat-btn {
    color: #2c2c2c !important;
}

.msg-avatar.user-avatar {
    background: #eef2ff !important;
    border-color: transparent !important;
    color: #3b82f6 !important;
}

.msg-avatar.agent-avatar {
    background: #f0f0f0 !important;
    border-color: transparent !important;
    color: #2c2c2c !important;
}

.msg-output blockquote {
    background: #f5f5f3 !important;
    border-left-color: #a3a3a3 !important;
}

.msg-output code,
.msg-output pre {
    background: #f5f5f3 !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.msg-output pre code {
    color: #2c2c2c !important;
}

.msg-output pre .code-lang-label {
    background: #e7e7e5 !important;
}

.sc-sidebar-overlay,
.sidebar-overlay {
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
    .auth-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .brand-logo .logo-icon {
        width: 44px;
        height: 44px;
    }

    .auth-card {
        border-radius: 18px;
    }
}

/* ===== Login soft split — Manus light ===== */
#login-page,
.auth-layout,
.auth-brand,
.auth-brand-content,
.auth-panel,
.auth-card {
    opacity: 1 !important;
    filter: none !important;
}

.auth-layout {
    background: #f8f8f6;
}

.auth-layout::before {
    z-index: 0;
    background-image: none;
    opacity: 0;
}

.auth-brand,
.auth-panel {
    position: relative;
    z-index: 1;
}

.auth-brand {
    background: #f0f0f0;
    color: #2c2c2c;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: clamp(32px, 4vw, 58px) clamp(44px, 6vw, 86px);
}

.brand-grid {
    background-image: none;
    opacity: 0;
}

.brand-shape {
    opacity: 0.5;
}

.brand-shape-1 {
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.02));
    box-shadow: none;
}

.brand-shape-2 {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.5);
}

.brand-shape-3 {
    width: 150px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), rgba(59, 130, 246, 0.22));
}

.brand-logo {
    margin-bottom: clamp(18px, 2.4vw, 28px);
}

.brand-logo .logo-icon {
    width: 54px;
    height: 54px;
    filter: none;
}

.auth-trademark {
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: visible;
}

.auth-trademark-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-trademark-hero {
    width: 220px;
    height: 53px;
}

.auth-trademark-card {
    width: 154px;
    height: 37px;
}

.brand-logo-text strong {
    color: #2c2c2c;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(25px, 2.6vw, 32px);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand-logo-text em {
    color: #8a8a8a;
    letter-spacing: 0.06em;
}

.brand-kicker {
    color: #8a8a8a;
}

.brand-headline {
    color: #2c2c2c;
    text-shadow: none;
    font-size: clamp(30px, 3.8vw, 42px);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
}

.brand-sub {
    color: #6b6b6b;
    line-height: 1.62;
    margin-bottom: clamp(18px, 2.4vw, 26px);
}

.brand-features {
    gap: 10px;
}

.brand-features li {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    padding: 13px 15px;
    border-radius: 14px;
}

.brand-features li:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.brand-features li strong {
    color: #2c2c2c;
}

.brand-features li span:not(.brand-feature-icon) {
    color: #6b6b6b;
}

.brand-feature-icon {
    color: #ffffff;
    background: #3b82f6;
    box-shadow: none;
}

.brand-feature-icon::after {
    background: rgba(59, 130, 246, 0.12);
}

.auth-panel {
    background: #f8f8f6;
}

.auth-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.auth-card::before {
    height: 0;
}

.auth-card-brand strong {
    color: #2c2c2c;
}

.auth-card-brand span,
.tagline {
    color: #8a8a8a;
}

.auth-card .form-group label {
    color: #4a4a4a;
    font-weight: 500;
}

.auth-card .form-group input {
    background: #f5f5f3;
    border-color: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
}

.auth-card .form-group input::placeholder {
    color: #a3a3a3;
}

.auth-tabs {
    background: #f0f0f0;
    border-color: transparent;
    border-radius: 12px;
}

.tab-btn {
    color: #8a8a8a;
}

.tab-btn.active {
    background: #ffffff;
    color: #2c2c2c;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.auth-form .btn-primary,
.btn-google {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.auth-form .btn-primary:hover,
.btn-google:hover {
    background: #4b8ef7;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.24);
}

/* Published/app application cards */
.app-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border-radius: 16px;
}

.app-card:hover {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.app-card-name,
.app-card-value,
.app-social-btn strong,
.app-card-placeholder-title {
    color: #2c2c2c;
}

.app-card-label,
.app-prod-link-empty,
.app-card-placeholder-sub {
    color: #8a8a8a;
}

.app-card-id,
.app-visibility-badge.is-private {
    background: #f0f0f0;
    color: #6b6b6b;
}

.app-visibility-badge.is-public {
    background: #f0fdf4;
    color: #15803d;
}

.app-visibility-badge.is-category {
    background: #eef6ff;
    color: #1d4ed8;
}

.app-card-preview {
    background: #f5f5f3;
    border-color: rgba(0, 0, 0, 0.05);
}

.app-card-thumbnail-shell,
.app-card-preview-default-icon {
    background: #f0f0f0;
}

.app-card-thumbnail-state {
    background: rgba(248, 248, 246, 0.9);
    color: #8a8a8a;
}

.app-card-thumbnail-shell.is-thumbnail-loaded .app-card-thumbnail-state {
    pointer-events: none;
}

.app-card-placeholder-icon {
    background: #eef2ff;
    color: #3b82f6;
}

.app-card-social {
    gap: 8px;
}

.app-social-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
    color: #6b6b6b;
    border-radius: 10px;
}

.app-social-btn:hover,
.app-social-btn.active {
    background: #f0f0f0;
    border-color: transparent;
    color: #2c2c2c;
}

.app-card-actions .btn-action {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
    color: #2c2c2c;
}

.app-card-actions .btn-action:hover {
    background: #f0f0f0;
    border-color: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
}

@media (max-width: 900px) {
    .auth-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

/* ===== Manus-like conversation typography and content hierarchy ===== */
.sc-feed,
.chat-feed {
    background: #f8f8f6 !important;
    padding: 12px 0 28px !important;
}

.sc-msg-turn,
.msg-turn {
    border-bottom: 0 !important;
}

.sc-msg-user-row,
.sc-msg-agent-row,
.msg-user-row,
.msg-agent-row {
    width: 100%;
    margin: 0;
    padding: 18px 20px !important;
    background: transparent !important;
    border: 0 !important;
}

.sc-msg-user-row,
.msg-user-row {
    padding-top: 24px !important;
    padding-bottom: 10px !important;
}

.sc-msg-agent-row,
.msg-agent-row {
    padding-top: 10px !important;
    padding-bottom: 30px !important;
}

.sc-msg-avatar,
.msg-avatar {
    width: 26px !important;
    height: 26px !important;
    background: #f0f0f0 !important;
    border: 0 !important;
    color: #6b6b6b !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.sc-msg-avatar.user,
.msg-avatar.user-avatar {
    background: #e9eef8 !important;
    color: #5373a8 !important;
}

.sc-msg-header,
.msg-header {
    margin-bottom: 9px !important;
}

.sc-msg-role,
.msg-role {
    color: #70706d !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.sc-msg-id,
.sc-msg-time,
.msg-id,
.msg-time {
    color: #aaa9a5 !important;
    font-size: 11px !important;
}

.sc-msg-text,
.msg-text {
    color: #3b3b39 !important;
    font-size: 15px !important;
    line-height: 1.72 !important;
}

.sc-msg-output,
.msg-output {
    color: #3b3b39 !important;
    font-size: 15px !important;
    line-height: 1.78 !important;
    letter-spacing: 0 !important;
}

.sc-msg-output p,
.msg-output p {
    margin: 0 0 14px !important;
}

.sc-msg-output h1,
.sc-msg-output h2,
.sc-msg-output h3,
.sc-msg-output h4,
.sc-msg-output h5,
.sc-msg-output h6,
.msg-output h1,
.msg-output h2,
.msg-output h3,
.msg-output h4,
.msg-output h5,
.msg-output h6 {
    color: #242422 !important;
    border: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    font-weight: 650 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.015em;
}

.sc-msg-output h1,
.msg-output h1 {
    margin: 32px 0 16px !important;
    font-size: 23px !important;
}

.sc-msg-output h2,
.msg-output h2 {
    margin: 28px 0 14px !important;
    font-size: 20px !important;
}

.sc-msg-output h3,
.msg-output h3 {
    margin: 24px 0 12px !important;
    font-size: 17px !important;
}

.sc-msg-output h4,
.sc-msg-output h5,
.sc-msg-output h6,
.msg-output h4,
.msg-output h5,
.msg-output h6 {
    margin: 20px 0 10px !important;
    font-size: 15px !important;
}

.sc-msg-output strong,
.msg-output strong {
    color: #242422 !important;
    font-weight: 650 !important;
}

.sc-msg-output ul,
.sc-msg-output ol,
.msg-output ul,
.msg-output ol {
    margin: 12px 0 18px !important;
    padding-left: 24px !important;
}

.sc-msg-output li,
.msg-output li {
    margin: 7px 0 !important;
    padding-left: 2px;
}

.sc-msg-output li::marker,
.msg-output li::marker {
    color: #858581;
}

.sc-msg-output blockquote,
.msg-output blockquote {
    margin: 18px 0 !important;
    padding: 12px 16px !important;
    color: #62625f !important;
    background: #f0f0ee !important;
    border: 0 !important;
    border-left: 2px solid #b8b8b4 !important;
    border-radius: 0 10px 10px 0 !important;
}

.sc-msg-output code,
.msg-output code {
    padding: 2px 6px !important;
    color: #4b4b48 !important;
    background: #ececea !important;
    border: 0 !important;
    border-radius: 5px !important;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
}

.sc-msg-output pre,
.msg-output pre {
    position: relative;
    margin: 18px 0 22px !important;
    background: #f0f0ee !important;
    border: 1px solid rgba(0, 0, 0, 0.055) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    overflow: hidden;
}

.sc-msg-output pre code,
.sc-msg-output pre code.hljs,
.msg-output pre code,
.msg-output pre code.hljs {
    display: block;
    padding: 18px 20px !important;
    color: #353533 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 13px !important;
    line-height: 1.68 !important;
}

.sc-msg-output pre .code-lang-label,
.msg-output pre .code-lang-label {
    color: #92928e !important;
    background: #e7e7e4 !important;
    border-bottom-left-radius: 8px !important;
}

.sc-msg-output table,
.msg-output table {
    margin: 18px 0 22px !important;
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    border-radius: 10px;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
}

.sc-msg-output th,
.sc-msg-output td,
.msg-output th,
.msg-output td {
    padding: 10px 12px !important;
    border: 0 !important;
    border-right: 1px solid rgba(0, 0, 0, 0.055) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.055) !important;
}

.sc-msg-output th,
.msg-output th {
    color: #4b4b48 !important;
    background: #f0f0ee !important;
    font-weight: 600 !important;
}

.sc-msg-output tr:nth-child(even),
.msg-output tr:nth-child(even) {
    background: #fafaf8 !important;
}

.sc-msg-output hr,
.msg-output hr {
    margin: 26px 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.07) !important;
}

.sc-detail-composer {
    background: linear-gradient(to bottom, rgba(248, 248, 246, 0), #f8f8f6 22%) !important;
}

/* ===== Conversation surface depth and stronger information hierarchy ===== */
.sidebar {
    background: #e8e7e2;
    border-right: 1px solid rgba(31, 31, 28, 0.09);
}

.nav-item,
.sidebar-recent-item {
    color: #656560;
}

.nav-item.active,
.sidebar-recent-item.active {
    color: #242422;
    font-weight: 550;
}

.main-content,
.chats-split-view {
    background: #f2f1ed !important;
}

.chats-split-view .sc-main,
.chat-main {
    margin: 0;
    background: #f6f5f1 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.sc-welcome,
.sc-detail,
.sc-feed,
.chat-feed {
    background: #f6f5f1 !important;
}

.sc-detail-topbar {
    background: rgba(242, 241, 237, 0.96) !important;
    border-bottom: 1px solid rgba(31, 31, 28, 0.09) !important;
    box-shadow: 0 1px 0 rgba(31, 31, 28, 0.015);
}

.sc-detail-topbar-title,
.sc-welcome-title,
.view-header h2,
.commerce-page-title,
.profile-section-title,
.config-section-title,
.deploy-page-title {
    color: #242422 !important;
    font-weight: 600 !important;
}

.sc-welcome-sub,
.sc-detail-hint,
.sc-detail-hint-inline,
.sc-composer-hint {
    color: #85857f !important;
}

.sc-msg-user-row,
.sc-msg-agent-row,
.msg-user-row,
.msg-agent-row {
    width: 100%;
    max-width: none;
    margin: 0 !important;
}

.sc-msg-user-row,
.msg-user-row {
    padding: 22px 28px 16px !important;
    background: #eeede8 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(31, 31, 28, 0.055) !important;
    border-radius: 0;
}

.sc-msg-agent-row,
.msg-agent-row {
    padding: 20px 28px 36px !important;
    background: #f6f5f1 !important;
}

.sc-msg-role,
.msg-role {
    color: #565652 !important;
    font-weight: 600 !important;
}

.sc-msg-id,
.sc-msg-time,
.msg-id,
.msg-time {
    color: #92928c !important;
}

.sc-msg-text,
.sc-msg-output,
.msg-text,
.msg-output {
    color: #343431 !important;
}

.sc-detail-composer {
    background: linear-gradient(to bottom, rgba(246, 245, 241, 0), #f6f5f1 24%) !important;
}

.sc-composer-box,
.sc-detail-composer-box {
    background: #fbfaf7 !important;
    border-color: rgba(31, 31, 28, 0.09) !important;
    box-shadow: 0 1px 2px rgba(31, 31, 28, 0.025),
                0 8px 24px rgba(31, 31, 28, 0.05) !important;
}

.sc-composer-box:focus-within,
.sc-detail-composer-box:focus-within {
    border-color: rgba(31, 31, 28, 0.14) !important;
    box-shadow: 0 1px 2px rgba(31, 31, 28, 0.03),
                0 10px 32px rgba(31, 31, 28, 0.075) !important;
}

@media (max-width: 768px) {
    .sc-msg-user-row,
    .sc-msg-agent-row,
    .msg-user-row,
    .msg-agent-row {
        width: 100%;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* ===== Explore（blog / game / others）与首页模块 ===== */

/* -- Chat 顶栏「分享至 Blog」 / 「长图分享」 -- */
.sc-share-blog-btn,
.sc-share-long-img-btn {
    flex-shrink: 0;
    padding: 5px 10px;
    border: 1px solid rgba(124, 106, 240, 0.28);
    border-radius: 999px;
    color: var(--accent-purple);
    background: rgba(124, 106, 240, 0.10);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sc-share-blog-btn:hover,
.sc-share-long-img-btn:hover {
    background: rgba(124, 106, 240, 0.18);
}

.sc-share-long-img-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* 长图导出离屏模板（html2canvas 截取用） */
.sc-long-share-root {
    box-sizing: border-box;
    width: 720px;
    padding: 0;
    background: #f4f3ee;
    color: #242422;
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.55;
}

.sc-long-share-root *,
.sc-long-share-root *::before,
.sc-long-share-root *::after {
    box-sizing: border-box;
}

.sc-long-share-header {
    padding: 28px 32px 22px;
    background: linear-gradient(160deg, #2a2926 0%, #3d3a34 55%, #4a4338 100%);
    color: #f7f4ec;
}

.sc-long-share-brand {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(247, 244, 236, 0.72);
    margin-bottom: 10px;
}

.sc-long-share-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.sc-long-share-meta {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(247, 244, 236, 0.55);
}

.sc-long-share-body {
    padding: 22px 28px 8px;
}

.sc-long-share-turn {
    margin-bottom: 18px;
}

.sc-long-share-bubble {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(31, 31, 28, 0.08);
}

.sc-long-share-bubble.user {
    background: #eeede8;
}

.sc-long-share-bubble.agent {
    background: #ffffff;
}

.sc-long-share-role {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
}

.sc-long-share-bubble.user .sc-long-share-role {
    color: #6b5ce0;
}

.sc-long-share-bubble.agent .sc-long-share-role {
    color: #2f6f5e;
}

.sc-long-share-time {
    font-weight: 500;
    color: #8a8a84;
}

.sc-long-share-text {
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #242422;
}

.sc-long-share-output {
    font-size: 14px;
    word-break: break-word;
    color: #242422;
}

.sc-long-share-output p {
    margin: 0 0 0.75em;
}

.sc-long-share-output p:last-child {
    margin-bottom: 0;
}

.sc-long-share-output h1,
.sc-long-share-output h2,
.sc-long-share-output h3,
.sc-long-share-output h4,
.sc-long-share-output h5,
.sc-long-share-output h6 {
    margin: 1em 0 0.45em;
    line-height: 1.3;
    color: #1f1f1c;
}

.sc-long-share-output h1 { font-size: 1.35em; }
.sc-long-share-output h2 { font-size: 1.22em; }
.sc-long-share-output h3 { font-size: 1.1em; }

.sc-long-share-output ul,
.sc-long-share-output ol {
    margin: 0.4em 0 0.8em;
    padding-left: 1.4em;
}

.sc-long-share-output li {
    margin: 0.2em 0;
}

.sc-long-share-output blockquote {
    margin: 0.6em 0;
    padding: 0.4em 0.9em;
    border-left: 3px solid rgba(124, 106, 240, 0.45);
    color: #5c5c56;
    background: rgba(124, 106, 240, 0.06);
}

.sc-long-share-output code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(31, 31, 28, 0.06);
}

.sc-long-share-output pre {
    margin: 0.7em 0;
    padding: 12px 14px;
    overflow: auto;
    border-radius: 10px;
    background: #2a2926;
    color: #f2f0e8;
}

.sc-long-share-output pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.sc-long-share-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.7em 0;
    font-size: 13px;
}

.sc-long-share-output th,
.sc-long-share-output td {
    border: 1px solid rgba(31, 31, 28, 0.12);
    padding: 6px 8px;
    text-align: left;
}

.sc-long-share-output th {
    background: rgba(31, 31, 28, 0.04);
}

.sc-long-share-output img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.sc-long-share-attach {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sc-long-share-attach-item {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(31, 31, 28, 0.06);
    color: #5c5c56;
}

.sc-long-share-footer {
    padding: 18px 32px 28px;
    text-align: center;
    font-size: 12px;
    color: #8a8a84;
}

/* -- Explore 页头与面板 --
   分类切换单独占一行并左对齐（未登录落地页的 .lp-gallery-tabs 同理）：
   分类是这一页的主导航，不该被挤到右上角。 */
.explore-tabs {
    margin-bottom: 16px;
}

/* 二级目录（APP 的 Game/Others、Blog 与未登录「使用案例」的 全部/APP/Image）：
   只在对应的一级分类下出现，视觉上比一级弱一档，让人一眼看出这是从属关系
   而不是并列的分类。 */
.explore-subtabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -8px 0 16px;
    padding-left: 2px;
    /* 「使用案例」下有五个胶囊，窄屏一行放不下：换行而不是撑出横向滚动条 */
    flex-wrap: wrap;
    row-gap: 8px;
}

/* 未登录「使用案例」里它是卡片容器的第一个元素，上方没有一级 tab 可贴，
   负的上外边距会把它顶进容器内边距里，这里收掉。 */
#lp-cases-subtabs {
    margin-top: 0;
}

.explore-subtab-btn {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.explore-subtab-btn:hover {
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.35);
}

.explore-subtab-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

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

.explore-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.explore-panel-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Blog 列表的视角切换：全部 / 我的分享 / 我的收藏 */
.explore-scope-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.explore-scope-btn {
    flex: none;
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.explore-scope-btn:hover {
    color: var(--text-primary);
}

.explore-scope-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-weight: 600;
}

/* -- Explore / 落地页的公开应用网格 --
   与「我的应用」共用 .app-card，但这里是展示位而不是管理列表：卡片上只有封面、
   应用名和点赞 / 收藏，没有编辑按钮和状态徽章，所以把空间尽量让给封面。
   轨道下限同样随视口放大，宽屏是把卡片做大而不是一味加列。 */
.explore-app-grid {
    --explore-app-min: 320px;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--explore-app-min), 100%), 1fr));
    gap: 20px;
}

@media (min-width: 1280px) {
    .explore-app-grid {
        --explore-app-min: 380px;
    }
}

@media (min-width: 1720px) {
    .explore-app-grid {
        --explore-app-min: 440px;
    }
}

/* 空态 / 加载态横跨整行，否则会被挤成一列宽 */
.explore-app-grid > .blog-list-empty,
.explore-app-grid > .blog-list-loading {
    grid-column: 1 / -1;
}

/* 封面比管理列表更高（16:10 而不是 16:9），卡片内边距收一点：
   展示位上封面才是主角，标题和两个计数按钮贴在下面即可。 */
.explore-app-grid .app-card {
    gap: 12px;
    padding: 14px;
}

.explore-app-grid .app-card-preview {
    aspect-ratio: 16 / 10;
}

.explore-app-grid .app-card-name {
    font-size: 17px;
}

/* -- 博客列表：分页卡片网格 --
   一篇分享只有标题 + 描述，横向长条会显得很空，所以按卡片铺开；
   登录后的 Explore 与未登录落地页共用这一套（blogRenderCard）。

   轨道下限用变量随视口放大：只靠 auto-fill 的话，屏幕越宽只会加列、卡片始终是
   最小宽度，封面被压成又扁又窄的一条。宽屏抬高下限，列数不变而卡片跟着变大。 */
.blog-list {
    --blog-card-min: 340px;
    display: grid;
    /* min(var, 100%)：窄屏容器不足下限时轨道回落到容器宽度，避免整行溢出 */
    grid-template-columns: repeat(auto-fill, minmax(min(var(--blog-card-min), 100%), 1fr));
    gap: 20px;
}

@media (min-width: 1280px) {
    .blog-list {
        --blog-card-min: 380px;
    }
}

@media (min-width: 1720px) {
    .blog-list {
        --blog-card-min: 440px;
    }
}

/* 网格里的空态 / 加载态要横跨整行，否则会被挤成一列宽 */
.blog-list > .blog-list-empty,
.blog-list > .blog-list-loading {
    grid-column: 1 / -1;
}

.blog-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 260px;
    padding: 20px 22px 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.blog-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.blog-card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* 分类标签：Blog 信息流里同时有「分享应用」和「分享图片」两种卡片，用一个小标签
   说明这篇属于哪一类。它跟作者、日期同属「这篇分享的元信息」，所以并排放在卡片
   底部那一行里，不再单独占一行高度——省下的高度全给封面。 */
.blog-card-tag {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.blog-card-tag.is-image {
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

.blog-card-tag.is-app {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
}

.blog-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-card-title {
    color: var(--accent-primary);
}

/* 卡片视觉区：第一个设置了封面图的相关应用。按 16:9 随卡片宽度缩放，卡片越宽封面
   越大——之前是固定 5 行文本的高度（≈119px），宽屏下就成了又扁又窄的一条。
   底部信息靠 .blog-card-bottom 的 margin-top:auto 贴底，所以封面和纯文本描述不再
   需要一样高也能对齐。 */
.blog-card-cover {
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.blog-card-cover-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 描述是纯文本，和详情正文一样保留作者的换行（pre-line：只认 \n，行首缩进不带进来）。
   固定 5 行高度：不足补白、超出截断并省略号，让纯文本卡片之间高度一致；跟有封面的
   卡片之间则靠 .blog-card-bottom 贴底对齐。 */
.blog-card-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 5 行 × line-height 1.7；flex 子项固定住，不被父容器压缩 */
    height: calc(1.7em * 5);
    flex: 0 0 auto;
}

/* 有封面时描述整块收起。作者样式里写了 display: -webkit-box，会盖掉浏览器默认的
   [hidden] { display: none }，这里必须显式补回来。 */
.blog-card-summary[hidden] {
    display: none;
}

/* 卡片底部整块（应用按钮 + 作者与计数）靠下对齐：描述长短、有没有封面都不影响，
   一行里各卡片的按钮和页脚始终在同一条水平线上。 */
.blog-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

/* 相关应用跳转按钮，文案是应用名。按钮宽度由内容撑开，多个时换行排列。 */
.blog-card-apps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.blog-card-app-btn {
    flex: none;
    max-width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    /* button 不继承页面字体，与 .blog-attachment 一样显式接回来 */
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--accent-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: var(--transition);
}

.blog-card-app-btn:hover {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.1);
}

.blog-card-app-btn.is-disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.blog-card-app-btn.is-disabled:hover {
    border-color: var(--border-color);
    background: var(--bg-primary);
}

/* 超出展示上限的应用只留个计数，点卡片进详情看全部 */
.blog-card-app-more {
    font-size: 12px;
    color: var(--text-muted);
}

/* 作者信息与计数是两组独立内容：整组一起换行，绝不允许把作者名 / 日期本身
   压成两行。窄卡片下计数整体落到第二行，作者名过长时在组内省略号截断。 */
.blog-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    color: var(--text-muted);
}

.blog-card-identity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}

.blog-card-date {
    flex-shrink: 0;
}

/* 浏览 / 点赞 / 收藏 / 评论四个计数，卡片底部与详情页 meta 行共用 */
.blog-card-stats,
.blog-article-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.blog-stat {
    white-space: nowrap;
    color: var(--text-muted);
}

.blog-list-author {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 只在卡片页脚里做截断：评论区共用 .blog-list-author，那里允许正常换行 */
.blog-card-identity .blog-list-author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-list-dot {
    color: var(--text-muted);
}

.blog-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.blog-list-loading,
.blog-list-empty {
    padding: 40px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.blog-list-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.blog-list-empty-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* -- 博客详情 -- */
.blog-article {
    max-width: 760px;
    margin: 0 auto;
}

.blog-article-head {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.blog-article-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 650;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.blog-article-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    /* 正文是纯文本，仅保留换行 */
    white-space: pre-wrap;
    word-break: break-word;
}

/* 详情底部关联信息区：每行「标签：内容」，内容之间用顿号分隔。
   依次是对话历史、相关应用（文案就是应用名）、相关附件（文案就是文件名）。
   登录态与未登录态共用同一套（blogRenderActions）。 */
.blog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.blog-meta-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 14px;
    line-height: 1.7;
}

/* 三个标签都是四个字，不换行即天然对齐；内容多了只让右侧那列折行 */
.blog-meta-label {
    flex: none;
    color: var(--text-muted);
}

.blog-meta-values {
    flex: 1;
    min-width: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.blog-meta-sep {
    color: var(--text-muted);
}

/* 内容项是「正文里的链接」而不是按钮：button 去掉原生外观，与 <a> 表现一致 */
.blog-meta-link {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.blog-meta-link:hover {
    text-decoration: underline;
}

.blog-meta-link.is-disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 详情页关联区：应用封面卡、报告预览卡、附件（有封面 / 无封面分组）。
   附件卡复用 chat 产物那套 .msg-output-* 尺寸，blog.html 不加载 index.html 内联样式，
   所以把同一套规则放在这份全局表里。 */
.blog-related {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-related-label {
    font-size: 13px;
    color: var(--text-muted);
}

.blog-app-card-list,
.blog-report-card-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-app-card {
    display: inline-flex;
    flex-direction: column;
    width: 148px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.blog-app-card:hover:not(.is-disabled) {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.blog-app-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.blog-app-card-cover {
    display: block;
    width: 100%;
    height: 104px;
    background: var(--bg-secondary);
}

.blog-app-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-app-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.blog-app-card-name {
    padding: 6px 8px;
    font-size: 12px;
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-report-card {
    display: block;
    width: min(100%, 420px);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.blog-report-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.blog-report-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.blog-report-card-badge {
    flex: none;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(46, 200, 184, 0.14);
    color: var(--accent-primary);
    font-size: 11px;
}

.blog-report-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.blog-report-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.blog-report-card-summary {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.blog-report-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.blog-report-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
}

.blog-report-kpi-value {
    font-size: 14px;
    font-weight: 600;
}

.blog-report-kpi-delta {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.blog-actions .msg-output-block {
    margin-top: 0;
}

.blog-actions .msg-output-list + .msg-output-list {
    margin-top: 10px;
}

.msg-output-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.msg-output-media-list {
    gap: 10px;
}

button.msg-output-card,
button.msg-output-link {
    font: inherit;
    color: inherit;
    text-align: left;
}

.msg-output-card {
    display: inline-flex;
    flex-direction: column;
    width: 148px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition);
}

.msg-output-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.msg-output-cover {
    position: relative;
    display: block;
    width: 100%;
    height: 104px;
    background: var(--bg-secondary);
}

.msg-output-cover-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    opacity: 0.45;
}

/* 图标在 DOM 里排在 <img> 后面，不抬层级会半透明叠在画面正中 */
.msg-output-thumb {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.msg-output-card.is-thumb-loaded .msg-output-thumb {
    opacity: 1;
}

.msg-output-card:not(.is-output-image) .msg-output-thumb {
    display: none;
}

.msg-output-play {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    display: none;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    font-size: 10px;
    color: #fff;
    pointer-events: none;
}

.msg-output-card.is-output-video.is-thumb-loaded .msg-output-play {
    display: block;
}

.msg-output-card .msg-output-name {
    padding: 5px 8px;
    font-size: 11px;
    line-height: 16px;
    color: var(--text-secondary);
}

.msg-output-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 199, 88, 0.10);
    border: 1px solid rgba(255, 199, 88, 0.28);
    border-radius: 5px;
    font-size: 12px;
    line-height: 18px;
    color: #d28a30;
    cursor: pointer;
    transition: var(--transition);
    max-width: 240px;
    overflow: hidden;
    white-space: nowrap;
}

.msg-output-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-output-icon {
    flex-shrink: 0;
}

.msg-output-link.is-output-ready:hover {
    background: rgba(255, 199, 88, 0.20);
    border-color: rgba(255, 199, 88, 0.45);
}

.blog-meta-link.is-loading,
.blog-meta-link.is-presign-loading {
    opacity: 0.6;
    pointer-events: none;
}

.blog-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 320px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-attachment:hover {
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent-primary);
}

/* -- 详情页互动区：点赞 / 收藏 --
   与正文同宽（760px）左对齐；按钮宽度由内容撑开，不做等分。 */
.blog-social {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 760px;
    margin: 24px auto 0;
}

.blog-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    font: inherit;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.blog-social-btn strong {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
}

.blog-social-btn:hover,
.blog-social-btn.active {
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent-primary);
}

.blog-social-btn.active strong {
    color: var(--accent-primary);
}

/* -- 详情页评论区 -- */
.blog-comments {
    max-width: 760px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.blog-comments-title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 650;
    color: var(--text-primary);
}

.blog-comments-title span {
    color: var(--text-muted);
    font-weight: 500;
}

.blog-comment-editor {
    margin-bottom: 24px;
}

.blog-comment-input {
    width: 100%;
    resize: vertical;
    min-height: 76px;
    line-height: 1.6;
}

.blog-comment-editor-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
}

/* 未登录时替代输入框的提示条 */
.blog-comment-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-comment-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.blog-comment-delete {
    margin-left: auto;
    flex: none;
    padding: 2px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.blog-comment-delete:hover {
    color: var(--danger-color, #dc2626);
}

.blog-comment-content {
    margin-top: 8px;
    padding-left: 28px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    /* 评论是纯文本，仅保留换行 */
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .blog-comment-login {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.blog-attachment.is-presign-loading {
    opacity: 0.6;
    pointer-events: none;
}

.blog-attachment-source {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.10);
    font-size: 11px;
    color: var(--accent-primary);
}

/* 交互报告的 chip：和附件同一套外形，只把强调色提到边框上——它点开的是一份完整
   文档而不是一个待下载的文件，值得在一排附件里先被看见。是 <a>，所以要显式去掉下划线。 */
.blog-attachment.is-report {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
    text-decoration: none;
}

.blog-attachment.is-report:hover {
    border-color: var(--accent-primary);
}

/* 对话历史 */
.blog-message-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-message-turn {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-message-turn:last-child {
    border-bottom: none;
}

.blog-message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.blog-message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.blog-message-avatar.user {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.blog-message-avatar.agent {
    background: rgba(124, 106, 240, 0.15);
    color: var(--accent-purple);
}

.blog-message-body {
    flex: 1;
    min-width: 0;
}

.blog-message-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.blog-message-output {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
}

.blog-message-output pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    overflow: auto;
    font-size: 12.5px;
}

.blog-message-output code {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.9em;
}

.blog-message-output pre code {
    background: none;
    padding: 0;
}

.blog-message-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.blog-message-output th,
.blog-message-output td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
}

.blog-message-output img {
    max-width: 100%;
    border-radius: 6px;
}

.blog-message-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* -- 「分享至 Blog」表单 --
   弹窗宽度跟着视口走（见 .modal.modal-share-blog）：勾选项是文件名和应用名，
   窄弹窗里几乎全被截断。
   纵向分三层：正文 .share-blog-body 独立滚动，底栏 .share-blog-actions 常驻。 */
.share-blog-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
}

/* 唯一的滚动区。min-height:0 同 .modal-content，缺了就不会收缩。 */
.share-blog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 24px;
}

/* 附件单独一行；报告与应用并排。窄屏时并排那一行落回单列。 */
.share-blog-columns-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.share-blog-columns-pair .form-group,
.share-blog-files-row {
    min-width: 0;
}

@media (max-width: 640px) {
    .share-blog-columns-pair {
        grid-template-columns: 1fr;
    }
}

.share-blog-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 146, 58, 0.35);
    border-radius: 8px;
    background: rgba(212, 146, 58, 0.10);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* -- Explore → Image 画廊卡片（瀑布流）--
   图片分享只看图：卡片上没有标题、作者和日期，只有图本身加压在图上的点赞 /
   收藏 / 评论数，其余信息都在详情页。

   排版是瀑布流而不是等高网格：图片比例千差万别，固定 4:3 网格要么裁掉半张图，
   要么把竖图压成一条。瀑布流让每张图按原始比例完整展示，列数由容器宽度和
   --image-card-col 算出来（手机上收窄成两列）。代价是阅读顺序变成「先竖着排满
   一列再到下一列」，画廊场景可以接受。

   分列由 JS 做（blog.js 的 image flow 一节往最矮的列追加卡片），不再用 CSS 多列：
   多列容器在高度自适应时会重新平衡各列，滚动加载下一页时已经看过的图会整片跳位。
   JS 只读这里的 --image-card-col / --image-card-gap，改断点不用动脚本。 */
.image-card-grid {
    --image-card-col: 240px;
    --image-card-gap: 16px;
    display: flex;
    align-items: flex-start;
    gap: var(--image-card-gap);
}

/* 一列。flex: 1 1 0 让各列等宽平分容器（比 --image-card-col 只多不少），
   min-width: 0 保证宽图不会把列撑破。 */
.image-card-col {
    display: flex;
    flex-direction: column;
    gap: var(--image-card-gap);
    flex: 1 1 0;
    min-width: 0;
}

/* 手机上按 240px 列宽只能排一列，一张竖图就要占掉一整屏；收窄列宽换成两列，
   与常见图片流的浏览习惯一致。 */
@media (max-width: 640px) {
    .image-card-grid {
        --image-card-col: 150px;
        --image-card-gap: 12px;
    }

    /* 两列后卡片只有一百多像素宽，计数条按比例收一档，别把矮图整块盖住 */
    .image-card-stats {
        gap: 10px;
        padding: 16px 8px 7px;
        font-size: 11px;
    }
}

@media (min-width: 1280px) {
    .image-card-grid {
        --image-card-col: 300px;
    }
}

@media (min-width: 1720px) {
    .image-card-grid {
        --image-card-col: 350px;
    }
}

/* 空态 / 加载态要横跨整行，否则会被当成其中一列 */
.image-card-grid > .blog-list-empty,
.image-card-grid > .blog-list-loading {
    flex: 1 1 100%;
}

.image-card {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.image-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.image-card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.image-card-cover {
    position: relative;
    /* 图片还没加载完时先占一点高度，免得整列在加载过程中反复跳 */
    min-height: 120px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

/* 高度随原图比例走（不裁剪），宽度撑满卡片 */
.image-card-img {
    display: block;
    width: 100%;
    height: auto;
}

/* 没有封面 / 封面挂了的兜底块：没有图就没有高度，这里按 4:3 占位 */
.image-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 一组多张时右上角标出总数，让人知道点进去还有更多（右下角留给计数条） */
.image-card-count {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
}

/* 视频卡片的播放角标。封面是截帧，跟图片长得一模一样，不打这个标记没人知道
   点进去是能播的；居中不压住右上角的张数和右下角的计数条。 */
.image-card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding-left: 3px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 16px;
    pointer-events: none;
}

/* 点赞 / 收藏 / 评论压在图片底部：渐变遮罩保证浅色图上也读得清 */
.image-card-stats {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 12px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
    font-size: 12px;
    color: #fff;
    pointer-events: none;
}

.image-card-stats .blog-stat {
    color: #fff;
}

/* 瀑布流底部的状态条：正在加载 / 已经到底 / 加载失败可重试。
   它同时是「快滚到底了」的探针（IntersectionObserver 观察的就是这个元素），
   所以高度固定留一档，图片再少也要在文档流里占住位置。 */
.image-flow-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    padding: 18px 0 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.image-flow-tip {
    color: var(--text-muted);
}

/* -- 图片分享详情：原图 + Prompt -- */
.blog-image-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.blog-image-figure {
    margin: 0;
}

/* 原图按容器宽度自适应，超高的竖图也不至于把整页撑到读不下去 */
.blog-image-full {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
}

/* 详情里的视频和图片同宽同框；黑底而不是 --bg-tertiary，是因为播放器留白的部分
   （竖屏视频左右两条）贴着画面，浅色会显得画面被切了一刀。 */
.blog-video-full {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #000;
}

.blog-image-figure figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

.blog-prompt {
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.blog-prompt-head {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

/* Prompt 是要被整段复制走的，保留原始换行与空格，不做任何重排 */
.blog-prompt-body {
    margin: 0;
    padding: 12px 14px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* -- 「分享至 Blog」第一步：选分类 -- */
.share-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.share-category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.share-category-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.share-category-card.active {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.share-category-icon {
    font-size: 20px;
}

.share-category-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.share-category-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.share-subcategory-row {
    display: flex;
    gap: 8px;
}

.share-subcategory-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.share-subcategory-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* 第二步表单顶部的「已选分类 + 重新选择」 */
.share-blog-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.share-blog-chosen-label {
    color: var(--text-secondary);
}

.share-blog-chosen-value {
    font-weight: 650;
    color: var(--text-primary);
}

.share-blog-chosen-change {
    padding: 0;
    border: none;
    background: none;
    color: var(--accent-primary);
    font-size: 12px;
    cursor: pointer;
}

/* 封面下拉：候选来自已勾选的图片，宽度跟随弹窗，长文件名靠 ellipsis 收，不撑宽表单 */
.share-blog-cover-select {
    max-width: 100%;
    text-overflow: ellipsis;
}

/* 封面行：上传按钮和「移除」。视频分享与「其他」共用（见 blog.js 的 shareBlogCoverUploadHtml）。 */
.share-blog-cover-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 真正的 <input type="file"> 藏在 label 里，样式借用 .btn-secondary，
   所以这里只补「不换行 + 可点」这两件事 */
.share-blog-cover-upload {
    flex: 0 0 auto;
    white-space: nowrap;
    cursor: pointer;
}

/* 只在真的上传过封面之后才出现（JS 控 hidden） */
.share-blog-cover-clear {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
}

/* 高度跟视口走：矮屏（如 768p 笔记本）自动缩到 ~96px，高屏仍是原来的 ~150px。
   写 height 而不是只写 min-height，否则 textarea 的 rows 会把高度顶回去。 */
.share-blog-textarea {
    height: clamp(96px, 18vh, 150px);
    min-height: 96px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* 同 .share-blog-textarea：矮屏收到 ~140px，本身也带滚动，
   两栏勾选不会把「发布」挤出屏幕。
   只允许纵向滚动：overflow-y 一旦是 auto，未声明的 overflow-x 会被算成 auto，
   行内任何一点溢出都会冒出一条横向滚动条；长文件名交给 .share-blog-option-name 的 ellipsis。 */
.share-blog-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: clamp(140px, 26vh, 240px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
}

/* 勾选项做成可点整块的卡片：原生 checkbox 只留语义与键盘可达性，
   视觉上换成自绘的方框对勾，选中后整块高亮。 */
.share-blog-option {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.share-blog-option:hover {
    border-color: rgba(59, 130, 246, 0.28);
    background: var(--surface-hover);
}

.share-blog-option:hover .share-blog-option-box {
    border-color: var(--accent-primary);
}

.share-blog-option input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* 勾选方框必须在未勾选时也一眼看得见：--border-color 只有 16% 不透明度，
   画在同色系底上几乎消失，所以这里用 --line-strong 的实心描边并加深底色。 */
.share-blog-option-box {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface-panel);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.share-blog-option-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid var(--text-on-accent);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0.5);
    opacity: 0;
    transition: var(--transition);
}

.share-blog-option input[type="checkbox"]:checked ~ .share-blog-option-box {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
}

.share-blog-option input[type="checkbox"]:checked ~ .share-blog-option-box::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.share-blog-option input[type="checkbox"]:focus-visible ~ .share-blog-option-box {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.share-blog-option:has(input[type="checkbox"]:checked) {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
}

.share-blog-option-icon {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
}

.share-blog-option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-blog-option-tag {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    font-size: 11px;
    color: var(--text-muted);
}

/* ── 勾选栏里的封面预览卡（图片 / 视频）──────────────────────────────
   有封面可看的和没封面的分两组：卡片走网格，文件名行走原来的竖列。混在一排只能取
   同一个高度，迁就文件名行就把封面压成一个看不清的小方块（与 chat 的产物列表同一个
   取舍，见 chat-helpers.chatRenderMsgOutputs）。 */
.share-blog-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}

.share-blog-option-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 有卡片的那一栏放高一点：卡片比文件名行高得多，按原高度只露得出半排封面 */
.share-blog-picker:has(.share-blog-option-grid) {
    max-height: clamp(180px, 34vh, 340px);
}

/* 卡片是竖着的：封面在上，文件名和标签在下。
   .share-blog-option 的横向 flex 在这里全部让位，只留下选中态和边框那部分。 */
.share-blog-option.share-blog-option-card {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px;
    position: relative;
}

/* 勾选方框压在封面左上角：卡片里没有「行首」这个位置可以放它 */
.share-blog-option-card .share-blog-option-box {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

.share-blog-option-card .share-blog-option-box::after {
    top: 1px;
    left: 5px;
    width: 4px;
    height: 9px;
}

/* 封面框。占位图标一直在框里，<img> 只有加载成功（.is-thumb-loaded）才淡入盖住它，
   所以封面签不出来 / 加载失败就是留着图标，不会出现裂图或空白框。 */
.share-blog-card-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.share-blog-card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.share-blog-option-card.is-thumb-loaded .share-blog-card-thumb {
    opacity: 1;
}

.share-blog-card-icon {
    font-size: 22px;
    line-height: 1;
    opacity: 0.55;
}

/* 播放角标只在封面真的出来之后才有意义：没出图时下面那个 🎬 占位图标已经说明是视频了 */
.share-blog-card-play {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 1;
    display: none;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    font-size: 10px;
    color: #fff;
}

.share-blog-option-card.is-thumb-loaded .share-blog-card-play {
    display: block;
}

.share-blog-option-card[draggable="true"] {
    cursor: grab;
}

.share-blog-option-card.is-dragging {
    opacity: 0.45;
}

.share-blog-cover-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    pointer-events: none;
}

.share-blog-card-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
}

.share-blog-card-meta .share-blog-option-name {
    font-size: 12px;
}

/* 标题右侧的「已选 N / 共 M」：选中数为 0 时保持弱化，选中后转主题色 */
.share-blog-count {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.share-blog-count.active {
    color: var(--accent-primary);
}

.share-blog-picker-loading,
.share-blog-picker-empty {
    padding: 12px 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 常驻底栏：不参与滚动，屏幕再矮「发布」也点得到。
   背景要不透明，否则正文滚到底时字会透上来。 */
.share-blog-actions {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* 底栏左侧的勾选小结：勾选栏滚出视野后，这里仍能看到「会公开什么」 */
.share-blog-actions-summary {
    margin-right: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-muted);
}

/* 视口偏矮时（1366×768 这类笔记本、或窗口被压扁）进一步压缩固定占位，
   把省下的高度全留给可滚动正文 */
@media (max-height: 760px) {
    .modal.modal-share-blog .modal-header {
        padding: 13px 24px;
    }

    .share-blog-body {
        padding: 16px 20px;
    }

    .share-blog-notice {
        margin-bottom: 12px;
        padding: 9px 12px;
        font-size: 12px;
        line-height: 1.5;
    }

    .share-blog-actions {
        padding: 11px 20px;
    }
}

/* 窄屏：两栏已由 auto-fit 落回单列，这里只收一下内边距 */
@media (max-width: 640px) {
    .share-blog-body {
        padding: 16px;
    }

    .share-blog-actions {
        padding: 12px 16px;
    }

    .share-blog-actions-summary {
        display: none;
    }
}

/* 应用基本信息里的公开分类下拉 */
.app-basic-category-row {
    margin-top: 10px;
}

.app-basic-category-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.app-basic-category-row .status-select {
    width: auto;
    min-width: 160px;
}

/* 网格容器里的空态 / 加载态需要横跨整行，避免被挤成一列宽 */
.apps-card-grid > .blog-list-empty,
.apps-card-grid > .blog-list-loading {
    grid-column: 1 / -1;
}

/* =========================================================================
   未登录落地页（#login-page）

   视觉上不再自成一套：颜色、卡片、按钮全部走 themes.css 的主题变量，
   列表区块直接复用登录后的 .apps-card-container / .app-card / .blog-list /
   .app-pagination，登录前后是同一套 UI 语言。

   结构上分三个视图（.lp-view）：首页只讲平台本身，公开应用与使用案例各自独立成页，
   后续这两类内容变多也不会把首页撑爆。
   ========================================================================= */

/* .page.active 是 flex，落地页需要正常文档流才能纵向滚动 */
#login-page.active {
    display: block;
}

/* 本地已有 token 时，i18n 揭开 body 也不能先露出落地页。
   theme.js 在 <head> 同步写 data-has-session，不必等 app.js / /me。 */
html[data-has-session] #login-page,
html[data-has-session] #login-page.active {
    display: none;
}

html[data-has-session] #main-page,
html[data-has-session] #main-page.active {
    display: flex;
}

/* 不要在这里写 overflow: hidden：那会让 .lp-root 变成滚动容器，
   里面 position: sticky 的顶部导航就不再跟着页面滚动吸顶了。 */
/* 底色跟登录后的内容区（--surface-main）保持一致，别用比它更深的 canvas，
   否则登录前后切换会看到一次背景跳色。 */
.lp-root {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-main);
    color: var(--text-body);

    /* 插图画框专用的暗底：深浅两套主题下都固定不变，
       免得暗底插图边缘在浅色主题下露出一圈突兀的浅边。 */
    --lp-ink: #0a0e14;
    --lp-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* 顶部一层极淡的强调色辉光，给首屏一点纵深，不参与任何交互 */
.lp-root::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 0;
    width: min(1400px, 130%);
    height: 620px;
    transform: translateX(-50%);
    background:
        radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%, transparent 72%);
    pointer-events: none;
}

.lp-nav,
.lp-main,
.lp-footer {
    position: relative;
    z-index: 1;
}

body.lp-modal-open {
    overflow: hidden;
}

/* ===== 顶部导航 ===== */

.lp-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--surface-main) 82%, transparent);
    backdrop-filter: blur(16px) saturate(1.2);
}

.lp-nav-inner {
    width: min(1160px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
}

.lp-nav-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.lp-nav-brand img {
    height: 26px;
    width: auto;
    display: block;
}

.lp-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    /* 顶栏只剩四项（首页 / 使用案例 / 价格与权益 / 更新日志），Blog、应用广场、
       图片画廊、视频画廊都收进「使用案例」下拉，不再需要横向滚动条。
       这里必须保持不裁剪：overflow 一旦不是 visible，绝对定位的下拉会被切掉。
       万一以后项目又变多，用换行而不是横滑。 */
    min-width: 0;
    flex-wrap: wrap;
}

/* 导航项是 <a href="/cases"> 而不是 <button>：爬虫只跟着 href 走，
   哈希路由 SPA 里 onclick 切视图对它们等于不存在。人点击时由
   landing.js 的 landingNavClick() preventDefault，仍然走站内切换。 */
.lp-nav-link {
    display: inline-block;
    flex: 0 0 auto;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-subtle);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.lp-nav-link:hover {
    color: var(--text-heading);
    background: var(--surface-hover);
}

.lp-nav-link.active {
    color: var(--text-heading);
    background: var(--surface-active);
    font-weight: 600;
}

/* ===== 顶栏下拉：「使用案例」下挂 Blog / 应用广场 / 图片画廊 / 视频画廊 ===== */

.lp-nav-group {
    position: relative;
    flex: 0 0 auto;
}

/* 触发器是 <button>，其余导航项是 <a>；.lp-nav-link 那套样式两者共用，
   这里只补一个功能性的小箭头（落地页不放装饰图标，这个是展开状态的指示器）。 */
.lp-nav-group-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lp-nav-group-trigger::after {
    content: '';
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    opacity: 0.6;
    transition: var(--transition);
}

.lp-nav-group.is-open .lp-nav-group-trigger::after {
    transform: translateY(1px) rotate(-135deg);
    opacity: 1;
}

.lp-nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 40;
    min-width: 176px;
    padding: 6px;
    border: 1px solid var(--line-default);
    border-radius: 10px;
    background: var(--surface-panel);
    box-shadow: var(--shadow-lg);
    /* 收起时不用 display:none：留着可聚焦性会乱，但完全移除又会让过渡失效，
       所以用「不可见 + 不可点 + 位移」，展开时再放开。 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: var(--transition);
}

.lp-nav-group.is-open .lp-nav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* 桌面上鼠标悬停就能展开；触摸屏没有 hover，只走点击（landing.js 的 toggleLandingNavGroup）。
   悬停时不改 aria-expanded，它跟着显式的展开/收起走。
   刻意不写 :focus-within——键盘用户是 Enter 打开（拿到 .is-open）、Esc 关闭并把焦点退回
   触发器，若再挂 :focus-within，Esc 之后焦点一回到触发器菜单又会自己弹开，等于关不掉。
   菜单收起时是 visibility: hidden，子项本来就不可聚焦，键盘 Tab 不会走进关着的菜单。 */
@media (hover: hover) and (pointer: fine) {
    .lp-nav-group:hover .lp-nav-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
}

.lp-nav-menu-item {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.lp-nav-menu-item:hover {
    color: var(--text-heading);
    background: var(--surface-hover);
}

.lp-nav-menu-item.active {
    color: var(--text-heading);
    background: var(--surface-active);
    font-weight: 600;
}

.lp-nav-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    margin-left: auto;
}

.lp-nav-btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== 视图容器 ===== */

.lp-main {
    flex: 1;
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.lp-view[hidden] {
    display: none;
}

/* ===== Hero ===== */

.lp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 48px;
    padding: 72px 0 24px;
}

.lp-hero-copy {
    min-width: 0;
}

/* 全站统一的小标签：一段强调色短线 + 一行加了字距的说明，
   替代原来那种圆角小便签，视觉上更接近产品册的栏目名。 */
.lp-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--text-subtle);
}

.lp-eyebrow-mark {
    flex: none;
    width: 22px;
    height: 1px;
    background: var(--accent-primary);
}

.lp-hero-title {
    margin: 0;
    font-size: clamp(32px, 4.4vw, 52px);
    line-height: 1.18;
    font-weight: 700;
    letter-spacing: -0.038em;
    color: var(--text-heading);
}

.lp-hero-sub {
    margin: 18px 0 0;
    max-width: 34em;
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-body);
}

/* Hero 下方的三条「你能得到什么」要点 */
.lp-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.lp-btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.lp-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ===== Hero 右侧的纯 CSS 演示 ===== */

/* 底部留白要够放下浮出来的结果卡片：留得太少，卡片会压到输入框的发送按钮上 */
.lp-hero-visual {
    position: relative;
    min-width: 0;
    padding-bottom: 46px;
}

.lp-mock {
    position: relative;
    border: 1px solid var(--line-default);
    border-radius: 14px;
    background: var(--surface-panel);
    box-shadow: var(--elevation-3);
    overflow: hidden;
}

/* 顶栏上压一条强调色细线，让这块演示看起来是"设备"而不是一张截图 */
.lp-mock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 20%, transparent) 70%, transparent);
    z-index: 1;
}

.lp-mock-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-panel-muted);
}

.lp-mock-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line-strong);
}

.lp-mock-title {
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-faint);
}

.lp-mock-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px;
}

.lp-mock-msg {
    max-width: 90%;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
}

.lp-mock-user {
    align-self: flex-end;
    background: var(--surface-user-message);
    color: var(--text-body);
}

.lp-mock-agent {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: flex-start;
    width: 100%;
    background: var(--surface-agent-message);
    border: 1px solid var(--line-soft);
    color: var(--text-subtle);
}

.lp-mock-step {
    position: relative;
    padding-left: 18px;
}

.lp-mock-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 8px;
    height: 1px;
    background: var(--accent-primary);
}

.lp-mock-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface-panel-muted);
}

.lp-mock-input {
    flex: 1;
    font-size: 12px;
    color: var(--text-faint);
}

.lp-mock-caret {
    display: inline-block;
    width: 1px;
    height: 11px;
    margin-left: 3px;
    vertical-align: -1px;
    background: var(--accent-primary);
    animation: lpCaretBlink 1.1s ease infinite;
}

@keyframes lpCaretBlink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* 演示动效：对话与结果依次出现，只播一次，不做循环打扰阅读 */
@keyframes lpPopIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.lp-mock-user,
.lp-mock-agent,
.lp-mock-step,
.lp-mock-card {
    animation: lpPopIn 0.45s ease-out both;
}

.lp-mock-user { animation-delay: 0.25s; }
.lp-mock-agent { animation-delay: 1s; }
.lp-mock-step:nth-child(1) { animation-delay: 1.15s; }
.lp-mock-step:nth-child(2) { animation-delay: 1.75s; }
.lp-mock-step:nth-child(3) { animation-delay: 2.35s; }
.lp-mock-step:nth-child(4) { animation-delay: 2.95s; }
.lp-mock-card { animation-delay: 3.7s; }

.lp-mock-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    font-size: 13px;
}

.lp-mock-card {
    position: absolute;
    right: -6px;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border: 1px solid var(--line-default);
    border-radius: 12px;
    background: var(--surface-panel-strong);
    box-shadow: var(--elevation-2);
}

.lp-mock-card-text {
    display: flex;
    flex-direction: column;
}

.lp-mock-card-text strong {
    font-size: 13px;
    color: var(--text-heading);
}

.lp-mock-card-text span {
    font-size: 11px;
    color: var(--text-faint);
}

/* ===== 通用区块 ===== */

.lp-section {
    margin-top: 88px;
}

.lp-section-head {
    margin-bottom: 26px;
}

/* 区块编号 + 一条贯穿到底的细线：整页的"目录感"来自这里，
   比再加一行说明文字更克制，也更像产品册而不是宣传页。 */
.lp-section-index {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.lp-section-index span {
    font-family: var(--lp-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-primary);
}

.lp-section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-default), transparent);
}

.lp-section-title {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 680;
    letter-spacing: -0.032em;
    color: var(--text-heading);
}

.lp-section-sub {
    margin-top: 8px;
    max-width: 46em;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-subtle);
}

/* ===== 能做什么 ===== */

.lp-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* 卡片一律走"细线 + 极浅投影"，靠留白和字重分层次，不靠圆角和阴影堆体积；
   悬停时只点亮顶部一条强调色细线，克制但看得出来是可交互的。 */
.lp-feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 24px 22px;
    border: 1px solid var(--line-default);
    border-radius: 12px;
    background: var(--surface-panel);
    box-shadow: var(--elevation-1);
    transition: var(--transition);
}

.lp-feature-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 22px;
    right: 22px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lp-feature-card:hover {
    background: var(--surface-panel-strong);
    border-color: var(--line-strong);
    box-shadow: var(--elevation-2);
    transform: translateY(-2px);
}

.lp-feature-card:hover::before {
    opacity: 1;
}

.lp-feature-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 620;
    color: var(--text-heading);
}

.lp-feature-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-subtle);
}

/* 每张卡片底部固定一行「到手的是什么」，让描述落到结果上。
   标题只用字距和强调色区分，不做圆角便签——那种小色块会把整页拉回消费级观感。 */
.lp-feature-result {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-body);
}

.lp-feature-result-label {
    flex: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent-primary);
}

/* ===== 落地页插图（统一画框）=====
   插图是暗底的器件风成品图，所以画框固定给同一层暗底（--lp-ink）：
   深浅两套主题下都不换底色，避免图片边缘出现一圈突兀的浅边。
   案例封面例外——它放的是应用自己的浅色封面，见下面单独的 .lp-story-media。 */

.lp-shot,
.lp-story-media {
    position: relative;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line-default);
    border-radius: 14px;
    background: var(--lp-ink);
    box-shadow: var(--elevation-2);
}

/* 暗底插图压在浅色页面上时，边框用同色系的暗线，比主题的浅灰线更干净 */
.lp-shot {
    border-color: color-mix(in srgb, var(--lp-ink) 70%, var(--accent-primary));
}

.lp-story-media {
    background: var(--surface-panel-muted);
}

/* 图片的位移和缩放都走 CSS 变量：滚动视差改 --lp-par，悬停改 --lp-zoom，
   两者合成到同一个 transform 上，互相不会覆盖。 */
.lp-shot img,
.lp-story-media img {
    --lp-par: 0px;
    --lp-zoom: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate3d(0, var(--lp-par), 0) scale(var(--lp-zoom));
    transition: transform 0.6s ease;
}

.lp-shot img {
    aspect-ratio: 4 / 3;
}

/* 案例封面直接用应用自己的封面图（900×600），画框比例跟着原图走，
   避免把封面上的标题裁掉 */
.lp-story-media img {
    aspect-ratio: 3 / 2;
}

/* 插图本身已经是暗底，深色主题下只需要很轻的一点压暗；
   案例封面是浅色成品图，压暗幅度保持原样。 */
html[data-theme="dark"] .lp-shot img {
    filter: brightness(0.94);
}

html[data-theme="dark"] .lp-story-media img {
    filter: brightness(0.82) contrast(1.03);
}

/* 悬停时轻微推近，给静态插图一点"活"的反馈 */
.lp-shot:hover img,
.lp-story-card:hover .lp-story-media img {
    --lp-zoom: 1.03;
}

/* 滚动视差：landing.js 按元素在视口里的位置写 --lp-par，图片在画框里上下游走。
   底图先放大一点点，留出游走的余量，避免露出画框底色；跟随要跟手，所以过渡比悬停短得多。 */
.lp-parallax img {
    --lp-zoom: 1.1;
    transition: transform 0.18s linear;
}

.lp-parallax:hover img,
.lp-story-card:hover .lp-parallax img {
    --lp-zoom: 1.14;
}

/* 案例封面是应用自己的成品封面，上面带标题文字，放大太多会把字切掉，
   所以单独收窄放大倍数。 */
.lp-story-media.lp-parallax img {
    --lp-zoom: 1.05;
}

.lp-story-media.lp-parallax:hover img,
.lp-story-card:hover .lp-story-media.lp-parallax img {
    --lp-zoom: 1.08;
}

/* 缓慢浮动 + 周期性光扫，让整页不至于像一张死图 */
.lp-shot-float {
    animation: lpShotFloat 7s ease-in-out infinite;
}

.lp-shot-float::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.22) 50%, transparent 62%);
    transform: translateX(-130%);
    animation: lpShotShine 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lpShotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes lpShotShine {
    0%, 55% { transform: translateX(-130%); }
    85%, 100% { transform: translateX(130%); }
}

/* ===== 图 + 文两栏（当前首页没有用到，留给后续图文区块）===== */

.lp-split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 40px;
}

.lp-split-copy {
    min-width: 0;
}

.lp-uses-note {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-faint);
}

/* ===== 真实案例 ===== */

.lp-story-grid {
    display: grid;
    /* auto-fill：海外藏掉见引后只剩一张卡，不会被拉成通栏 */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* 案例列表下方的免责说明，比正文再轻一档：要能读到，但不抢卡片的注意力 */
.lp-story-disclaimer {
    margin-top: 16px;
    /* 它借用 .lp-section-sub 的字色和行高，但必须把那条 max-width: 46em 解开。
       46em 是按元素自己的字号算的，这里字号降到 13px，可用宽度就只剩 598px——
       区块本身有一千多像素也没用，中文这句 58 字（约 754px）照样被折成两行。
       这是页脚性质的注脚，不是需要控制阅读行长的正文段落，铺满整行更整齐。 */
    max-width: none;
    font-size: 13px;
    color: var(--text-muted, var(--text-subtle));
}

.lp-story-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-default);
    border-radius: 14px;
    background: var(--surface-panel);
    box-shadow: var(--elevation-1);
    transition: var(--transition);
}

.lp-story-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--elevation-2);
    transform: translateY(-2px);
}

.lp-story-media {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--line-soft);
    box-shadow: none;
}

.lp-story-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

/* 案例署名：应用名用强调色，右边跟一句说明它是什么形态的注脚。
   注脚只用一条竖细线隔开，不做圆角小标签。 */
.lp-story-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--accent-primary);
}

.lp-story-type {
    padding-left: 10px;
    border-left: 1px solid var(--line-default);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--text-faint);
}

/* 链到真实上线的应用；靠 margin-top:auto 让两张卡的链接对齐在同一条基线上 */
.lp-story-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    transition: gap 0.25s ease, opacity 0.25s ease;
}

.lp-story-link:hover {
    gap: 10px;
    opacity: 0.82;
}

/* 有的案例要给两个去处（成品链接 + 方案原文）。必须套一层容器来吃掉 margin-top: auto：
   两个链接各自带 auto 上边距时，flex 会把剩余空间在它们之间平分，两条链接会被顶开老远。 */
.lp-story-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    margin-top: auto;
}

.lp-story-links .lp-story-link {
    margin-top: 0;
}

.lp-story-quote {
    margin: 8px 0 0;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--text-heading);
}

.lp-story-body p {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-subtle);
}

/* ===== 两个内容入口 ===== */

.lp-entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.lp-entry-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    padding: 24px;
    border: 1px solid var(--line-default);
    border-radius: 12px;
    background: var(--surface-panel);
    box-shadow: var(--elevation-1);
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.lp-entry-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 24px;
    right: 24px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lp-entry-card:hover {
    background: var(--surface-panel-strong);
    border-color: var(--line-strong);
    box-shadow: var(--elevation-2);
    transform: translateY(-2px);
}

.lp-entry-card:hover::before {
    opacity: 1;
}

.lp-entry-main {
    flex: 1;
    min-width: 0;
}

.lp-entry-title {
    font-size: 17px;
    font-weight: 650;
    color: var(--text-heading);
}

.lp-entry-desc {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-subtle);
}

.lp-entry-count {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-faint);
}

.lp-entry-count strong {
    font-family: var(--lp-mono);
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    color: var(--accent-primary);
}

.lp-entry-arrow {
    flex-shrink: 0;
    align-self: center;
    color: var(--text-faint);
    font-size: 18px;
    transition: var(--transition);
}

.lp-entry-card:hover .lp-entry-arrow {
    color: var(--accent-primary);
    transform: translateX(3px);
}

/* ===== 付款成功页 ===== */

.lp-checkout-panel {
    max-width: 640px;
    padding: 28px 26px;
    border: 1px solid var(--line-default);
    border-radius: 12px;
    background: var(--surface-panel);
    box-shadow: var(--elevation-1);
}

.lp-checkout-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 2;
    color: var(--text-body);
}

.lp-checkout-actions {
    margin-top: 24px;
}

.lp-checkout-help {
    margin: 18px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-faint);
}

/* ===== 子页面（公开应用 / 使用案例） ===== */

.lp-view-head {
    padding: 40px 0 22px;
}

.lp-view-title {
    margin: 0;
    font-size: clamp(23px, 2.4vw, 30px);
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--text-heading);
}

.lp-view-sub {
    margin: 10px 0 0;
    max-width: 52em;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-subtle);
}

/* 分类切换独立成行并左对齐，与登录后 Explore 的 .explore-tabs 一致 */
.lp-gallery-tabs {
    margin-bottom: 16px;
}

/* 访客版应用卡片：结构与登录后一致，只是把点赞 / 收藏换成只读统计 */
.lp-app-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-subtle);
}

.lp-app-open-hint {
    margin-left: auto;
    color: var(--accent-primary);
    font-weight: 600;
}

.lp-app-card.app-card {
    cursor: pointer;
}

/* ===== 页脚 ===== */

.lp-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--line-soft);
}

.lp-footer-brand {
    font-size: 13px;
    color: var(--text-faint);
}

/* ===== 登录 / 注册弹窗 ===== */

.lp-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 820;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lp-auth-modal.show {
    display: flex;
}

.lp-auth-backdrop {
    position: absolute;
    inset: 0;
    background: var(--surface-overlay);
}

/* .auth-card::before 用了 --ase-grad，原来定义在已删除的 .auth-layout 上 */
.lp-auth-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    --ase-grad: var(--ase-gradient);
}

.lp-auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-faint);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.lp-auth-close:hover {
    background: var(--surface-hover);
    color: var(--text-heading);
}

/* ===== 响应式 ===== */

@media (max-width: 1080px) {
    .lp-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        padding-top: 52px;
    }

    .lp-hero-visual {
        order: -1;
    }

    .lp-mock-card {
        position: static;
        margin-top: 12px;
    }

    .lp-split {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .lp-split .lp-shot {
        order: -1;
    }
}

@media (max-width: 768px) {
    .lp-nav-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .lp-nav-links {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .lp-nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* 下拉贴着触发器左对齐即可（这一行是整宽的，右侧有的是空间）；
       子项按触摸目标放大到 44px 高。 */
    .lp-nav-menu {
        min-width: 168px;
        max-width: calc(100vw - 32px);
    }

    .lp-nav-menu-item {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* 品牌 + 联系我们 + 登录 + 开始使用，360px 宽的手机一行放不下，
       让按钮组自己换行收窄，别把「开始使用」顶到屏幕外 */
    .lp-nav-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        min-width: 0;
    }

    .lp-nav-btn {
        padding: 7px 12px;
        font-size: 13px;
    }

    .lp-main {
        padding: 0 16px 56px;
    }

    .lp-section {
        margin-top: 60px;
    }

    .lp-footer {
        padding: 20px 16px;
    }
}

/* -------------------------------------------------------------------------
   落地页滚动入场：默认不隐藏任何内容。
   只有 landing.js 确认浏览器支持 IntersectionObserver 后，才会给 .lp-root
   加上 .lp-reveal-ready，从而启用下面的隐藏 + 渐显；JS 不执行时页面照常可读。
   ------------------------------------------------------------------------- */

.lp-reveal-ready .lp-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.lp-reveal-ready .lp-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* 逐个飞入：给容器加 .lp-stagger，它的直接子元素会在区块进入视口后依次落位。
   延迟写死到第 8 个，再多的子元素跟着第 8 个一起进来，不会一直排队等下去。 */
.lp-reveal-ready .lp-stagger > * {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lp-reveal-ready .lp-reveal.is-in .lp-stagger > * {
    opacity: 1;
    transform: none;
}

.lp-reveal-ready .lp-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.lp-reveal-ready .lp-stagger > *:nth-child(2) { transition-delay: 0.12s; }
.lp-reveal-ready .lp-stagger > *:nth-child(3) { transition-delay: 0.19s; }
.lp-reveal-ready .lp-stagger > *:nth-child(4) { transition-delay: 0.26s; }
.lp-reveal-ready .lp-stagger > *:nth-child(5) { transition-delay: 0.33s; }
.lp-reveal-ready .lp-stagger > *:nth-child(6) { transition-delay: 0.40s; }
.lp-reveal-ready .lp-stagger > *:nth-child(7) { transition-delay: 0.47s; }
.lp-reveal-ready .lp-stagger > *:nth-child(n + 8) { transition-delay: 0.54s; }

/* 图文两栏：图从外侧滑进来、文字从内侧跟上，比两边一起淡入更有方向感 */
.lp-reveal-ready .lp-slide-left,
.lp-reveal-ready .lp-slide-right {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lp-reveal-ready .lp-slide-left {
    transform: translateX(-26px);
}

.lp-reveal-ready .lp-slide-right {
    transform: translateX(26px);
    transition-delay: 0.1s;
}

.lp-reveal-ready .lp-reveal.is-in .lp-slide-left,
.lp-reveal-ready .lp-reveal.is-in .lp-slide-right {
    opacity: 1;
    transform: none;
}

/* 窄屏上两栏已经堆成一列，再左右滑会顶出横向滚动条，换成和其它元素一样的上移 */
@media (max-width: 1080px) {
    .lp-reveal-ready .lp-slide-left,
    .lp-reveal-ready .lp-slide-right {
        transform: translateY(18px);
    }
}

/* 标题先到、副标题后到，读起来有先后顺序 */
.lp-reveal-ready .lp-section-head .lp-section-sub {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.12s, transform 0.5s ease 0.12s;
}

.lp-reveal-ready .lp-reveal.is-in .lp-section-head .lp-section-sub {
    opacity: 1;
    transform: none;
}

/* 用户在系统里关掉动效时，落地页只保留静态图，不做任何动画 */
@media (prefers-reduced-motion: reduce) {
    .lp-mock-user,
    .lp-mock-agent,
    .lp-mock-step,
    .lp-mock-card,
    .lp-mock-caret {
        animation: none;
    }

    /* 顶栏下拉：直接显示 / 隐藏，不做位移和淡入，箭头也不转 */
    .lp-nav-menu,
    .lp-nav-group-trigger::after {
        transition: none;
    }

    .lp-nav-menu {
        transform: none;
    }

    .lp-shot-float {
        animation: none;
    }

    .lp-shot-float::after {
        display: none;
    }

    .lp-shot img,
    .lp-story-media img {
        transition: none;
    }

    .lp-shot:hover img,
    .lp-story-card:hover .lp-story-media img {
        transform: none;
    }

    .lp-reveal-ready .lp-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .lp-reveal-ready .lp-stagger > *,
    .lp-reveal-ready .lp-slide-left,
    .lp-reveal-ready .lp-slide-right,
    .lp-reveal-ready .lp-section-head .lp-section-sub {
        opacity: 1;
        transform: none;
        transition: none;
        transition-delay: 0s;
    }

    .lp-parallax img,
    .lp-parallax:hover img,
    .lp-story-card:hover .lp-parallax img {
        --lp-par: 0px;
        --lp-zoom: 1;
        transition: none;
    }

    .lp-story-link {
        transition: none;
    }

    .lp-feature-card,
    .lp-feature-card::before,
    .lp-entry-card,
    .lp-entry-card::before {
        transition: none;
    }
}

/* ============ 交互报告：manifest v1 看板内容样式 ============ */
/* 由 web/js/report-dashboard.js 渲染的 DOM 用这一套类名。chat 的 Artifact 侧栏、
   首页侧栏、博客的报告页（blog-report.html）都要用，所以从各页面的内联 <style>
   提到这里；侧栏外壳（#sc-artifact-panel / -body 等）仍留在各自页面里。 */
.sc-artifact-loading,
.sc-artifact-error,
.sc-artifact-empty {
    padding: 40px 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.sc-artifact-error { color: var(--accent-danger, #f85149); }
.sc-artifact-summary {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent-primary);
    background: var(--bg-secondary);
    border-radius: 0 10px 10px 0;
}
.sc-artifact-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}
.sc-artifact-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 140px;
    flex: 1;
}
.sc-artifact-filter select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.sc-artifact-filter select:focus {
    outline: none;
    border-color: var(--accent-primary);
}
.sc-artifact-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.sc-artifact-kpi {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}
.sc-artifact-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    opacity: 0.85;
}
.sc-artifact-kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.sc-artifact-kpi-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.sc-artifact-kpi-unit {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.sc-artifact-kpi-delta {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
}
.sc-artifact-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 4px 0 10px;
    letter-spacing: 0.02em;
}
.sc-artifact-charts,
.sc-artifact-tables {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}
.sc-artifact-chart-card,
.sc-artifact-table-card {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 14px 10px;
    background: var(--bg-secondary);
}
.sc-artifact-chart-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.sc-artifact-chart-canvas {
    width: 100%;
    height: clamp(260px, 32vh, 360px);
}
.sc-artifact-table-wrap {
    overflow: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.sc-artifact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.sc-artifact-table th,
.sc-artifact-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 9px 12px;
    text-align: left;
    white-space: nowrap;
    color: var(--text-secondary);
}
.sc-artifact-table th {
    background: var(--bg-primary);
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
.sc-artifact-table tbody tr:hover td {
    background: rgba(88, 166, 255, 0.06);
    color: var(--text-primary);
}
.sc-artifact-table tr:last-child td {
    border-bottom: none;
}
.sc-artifact-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.sc-artifact-pager button {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 7px;
    padding: 5px 12px;
    cursor: pointer;
}
.sc-artifact-pager button:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.sc-artifact-pager button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.sc-artifact-ask {
    position: sticky;
    bottom: 0;
    margin: 8px -20px -20px;
    padding: 14px 20px 16px;
    background: linear-gradient(180deg, transparent, var(--bg-primary) 28%);
    border-top: 1px solid transparent;
}
.sc-artifact-ask-btn {
    width: 100%;
    border: 1px solid var(--accent-primary);
    background: rgba(88, 166, 255, 0.12);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--accent-primary);
}
.sc-artifact-ask-btn:hover {
    background: rgba(88, 166, 255, 0.2);
}

/* ===== 侧栏 Schedule：定时任务 =====
   窄屏优先：表格在 768px 以下整行拆成卡片（display:block + 每格自带标签），
   而不是给表格套一个横向滚动条——横滚在手机上等于「看不到操作列」。 */

.schedule-panel-sub {
    margin: 0 0 12px;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.6;
}

.schedule-quota-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-warning) 34%, var(--surface-panel));
    background: color-mix(in srgb, var(--accent-warning) 13%, var(--surface-panel));
    border-radius: var(--border-radius);
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.6;
}

/* 面板头是 flex + space-between，按钮不写 flex:none 会在窄屏被标题挤扁 */
#schedule-new-task-btn {
    flex: none;
    white-space: nowrap;
}

.schedule-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
}

.schedule-table th {
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--line-default);
    color: var(--text-subtle);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

.schedule-table tr.is-paused td {
    opacity: 0.62;
}

/* 七列按预估内容宽度的比例拆 100%，跟着表格一起随视口伸缩。
   不要把剩余宽度堆在某一列：堆标题则时间被挤折行，堆时间则时间超宽。
   min-width 防止窄屏把徽章/按钮压没；低于 768px 整表改卡片，这条不生效。 */
.schedule-col-id {
    width: 6%;
    min-width: 44px;
    padding-left: 4px;
    padding-right: 8px;
    color: var(--text-faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.schedule-col-title {
    width: 20%;
    min-width: 140px;
}

.schedule-task-title {
    color: var(--text-heading);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-col-status {
    width: 8%;
    min-width: 68px;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
}

.schedule-col-time {
    width: 22%;
    min-width: 168px;
}

.schedule-task-rule {
    color: var(--text-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 表格里的时间是按浏览器所在时区渲染的，这一行把那个时区写出来。
   不写的话，同一条任务在两台机器上显示成两个时刻，用户会以为数据错了。 */
.schedule-task-tz {
    color: var(--text-faint);
    font-size: 11px;
    line-height: 1.45;
    margin: 3px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-col-history {
    width: 12%;
    min-width: 96px;
    white-space: nowrap;
}

/* 最近一次「提示词检查」对话：chatId + 它此刻的状态。
   状态是随列表下发的快照，不实时刷，所以这一格不需要留出跳动的余量。
   nowrap 之外还要 hidden + 省略号：状态词在英文站更长（Terminated / Running），
   chatId 位数也会涨，fixed 布局下溢出的字会直接压到「操作」那一列上。 */
.schedule-col-review {
    width: 12%;
    min-width: 104px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-review-link {
    color: var(--accent-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-decoration: none;
}

.schedule-review-link:hover {
    text-decoration: underline;
}

.schedule-review-status {
    color: var(--text-faint);
    font-size: 11px;
    margin-left: 6px;
}

.schedule-review-empty {
    color: var(--text-faint);
}

.schedule-col-actions {
    width: 20%;
    min-width: 188px;
    padding-right: 4px;
    white-space: nowrap;
}

.schedule-status-badge,
.schedule-run-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 16px;
    border: 1px solid transparent;
}

.schedule-status-active,
.schedule-run-success {
    color: var(--accent-success);
    background: color-mix(in srgb, var(--accent-success) 13%, var(--surface-panel));
    border-color: color-mix(in srgb, var(--accent-success) 34%, var(--surface-panel));
}

.schedule-status-paused {
    color: var(--accent-warning);
    background: color-mix(in srgb, var(--accent-warning) 13%, var(--surface-panel));
    border-color: color-mix(in srgb, var(--accent-warning) 34%, var(--surface-panel));
}

.schedule-run-failed {
    color: var(--accent-danger);
    background: color-mix(in srgb, var(--accent-danger) 13%, var(--surface-panel));
    border-color: color-mix(in srgb, var(--accent-danger) 34%, var(--surface-panel));
}

.schedule-col-history .btn-link {
    color: var(--accent-primary);
    padding: 0;
}

.schedule-col-actions .btn-small {
    background: var(--surface-panel-muted);
    border: 1px solid var(--line-default);
    border-radius: 6px;
    color: var(--text-body);
    cursor: pointer;
    margin-right: 6px;
    transition: var(--transition);
}

.schedule-col-actions .btn-small:last-child {
    margin-right: 0;
}

.schedule-col-actions .btn-small:hover {
    background: var(--surface-hover);
}

.schedule-col-actions .schedule-danger-btn {
    color: var(--accent-danger);
    border-color: color-mix(in srgb, var(--accent-danger) 34%, var(--surface-panel));
}

.schedule-cell-hint {
    padding: 20px 12px;
    color: var(--text-faint);
    font-size: 13px;
    text-align: center;
}

/* ----- 新建 / 编辑弹窗 ----- */

.schedule-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.schedule-modal-card {
    max-width: 640px !important;
    width: 100%;
    /* 遮罩上下各 16px padding */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}

/* 执行历史只有三列短字段，不必撑到新建任务那一档宽度，否则时间列会被拉得很空。 */
.schedule-history-card {
    max-width: 520px !important;
}

/* 「要不要去看检查对话」只有两段说明加两个按钮，比表单窄一档读起来更整。 */
.schedule-review-card {
    max-width: 480px !important;
}

.schedule-review-note {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 21px;
    color: var(--text-secondary);
}

.schedule-review-note:last-child {
    margin-bottom: 0;
}

/* 第二步只填执行内容：弹窗拉到接近视口高度，输入框吃掉剩余空间，
   不再在小框里滚。内容超出时才在 textarea 上出现滚动。 */
.schedule-modal-card.is-content-step {
    max-width: min(920px, 100%) !important;
    width: 100%;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}

.schedule-modal-card .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto; /* layout-check: allow：弹窗内容区是唯一允许的内嵌滚动 */
    padding: 20px 24px;
}

.schedule-modal-card.is-content-step .modal-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.schedule-modal-card .modal-footer {
    flex: none;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.schedule-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.schedule-field:last-child {
    margin-bottom: 0;
}

.schedule-step-input,
.schedule-field-input {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.schedule-field > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-subtle);
}

.schedule-field-hint {
    font-size: 12px;
    color: var(--text-faint);
}

.schedule-time-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.schedule-select {
    width: auto;
    max-width: 160px;
    height: 38px;
    padding: 0 10px;
}

/* 时区选项写全了是 "America/Argentina/Buenos_Aires (UTC-03:00)"，
   .schedule-select 那 160px 会把它截成看不出是哪个区，所以单独放宽。 */
.schedule-tz-select {
    max-width: 100%;
    width: 100%;
}

.schedule-time-parts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.schedule-time-input {
    width: 62px;
    max-width: 62px;
    height: 38px;
    padding: 0 8px;
    text-align: center;
}

.schedule-time-colon {
    color: var(--text-faint);
}

/* 输入框整块沿用 new-chat 的 .sc-composer-* 样式，这里只补一层定位上下文：
   @ 下拉是绝对定位的，没有这层会跑到弹窗外面去。 */
.schedule-composer {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.schedule-composer .sc-composer-box {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.schedule-composer .sc-composer-textarea {
    min-height: 96px;
}

.schedule-modal-card.is-content-step .schedule-composer .sc-composer-textarea {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: hidden; /* 高度由 JS 按剩余视口贴合，内容超出时再改成 auto */
}

/* 「跳过检查」：勾选框在输入框正下方，说明另起一行。
   说明写全了才敢给这个口子——只放一个复选框，用户勾掉的是自己不知道存在的那层兜底。
   整行都是 label，手机上点文字也能勾中，不用去戳那个 16px 的方块。 */
.schedule-skip-review {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 2px 0;
    color: var(--text-body);
    font-size: 13px;
    line-height: 20px;
    cursor: pointer;
}

.schedule-skip-review input[type="checkbox"] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.schedule-skip-review-hint {
    margin: 6px 0 0 24px;
    color: var(--text-faint);
    font-size: 12px;
    line-height: 18px;
}

.schedule-composer .sc-composer-footer,
.schedule-composer .sc-pending-images {
    flex: none;
}

/* @ 下拉默认往上弹（chat 输入框在页面底部）。第一步弹窗里输入框还没到，
   往上弹会盖住执行时间，所以先翻到下面；第二步弹窗贴满视口，再改回往上弹。 */
.schedule-composer .mention-dropdown {
    top: calc(100% + 6px);
    bottom: auto;
}

.schedule-modal-card.is-content-step .schedule-composer .mention-dropdown {
    top: auto;
    bottom: 52px;
    max-height: 40%;
}

/* ----- 执行历史：table 让表头和每一行共用列宽。
   width:auto 按内容定列，时间列不会把剩余空间吃掉；字号按阅读来，不沿用列表里 10px 的徽章。 ----- */

.schedule-history-table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-history-table th {
    text-align: left;
    padding: 0 28px 10px 0;
    border-bottom: 1px solid var(--line-default);
    color: var(--text-faint);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-history-table td {
    padding: 12px 28px 12px 0;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    white-space: nowrap;
}

.schedule-history-table th:last-child,
.schedule-history-table td:last-child {
    padding-right: 0;
}

.schedule-history-time {
    color: var(--text-body);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}

.schedule-history-table .schedule-run-badge {
    font-size: 13px;
    line-height: 20px;
    padding: 2px 8px;
}

.schedule-history-chat {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}

.schedule-history-link {
    color: var(--accent-primary);
    text-decoration: none;
}

.schedule-history-link:hover {
    text-decoration: underline;
}

.schedule-history-empty {
    color: var(--text-faint);
}

/* ----- 移动端：表格拆成卡片 -----
   表头隐藏，每个单元格用 ::before 补上自己的字段名，整行变成一张卡片。
   这样窄屏下既不横滚、也不用把操作列藏起来。 */
@media (max-width: 768px) {
    .schedule-table,
    .schedule-table tbody,
    .schedule-table tr,
    .schedule-table td {
        display: block;
        width: 100%;
    }

    .schedule-table thead {
        display: none;
    }

    .schedule-table tr {
        border: 1px solid var(--line-soft);
        border-radius: var(--border-radius);
        padding: 12px;
        margin-bottom: 12px;
    }

    .schedule-table td {
        border-bottom: none;
        padding: 4px 0;
    }

    .schedule-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--text-faint);
        font-size: 11px;
        margin-bottom: 2px;
    }

    .schedule-table-wrap {
        overflow-x: visible;
    }

    .schedule-table {
        min-width: 0;
    }

    .schedule-col-id,
    .schedule-col-title,
    .schedule-col-status,
    .schedule-col-time,
    .schedule-col-history,
    .schedule-col-review,
    .schedule-col-actions {
        width: auto;
        max-width: none;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .schedule-task-title {
        white-space: normal;
    }

    .schedule-col-actions .btn-small {
        margin: 4px 6px 0 0;
    }

    .schedule-select,
    .schedule-time-input {
        height: 40px;
    }
}

/* ============================================================
   云盘（个人中心 → 云盘，#/files）
   卡片尺寸对齐 chat 里的产物卡（封面 104px 高），一屏能横排 5~7 个；
   操作按钮在 hover 设备上悬停浮现，触屏设备常驻并撑到 44px 热区。
   ============================================================ */

.uf-intro {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 20px;
    color: var(--text-secondary);
}

.uf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.uf-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
}

.uf-card:hover,
.uf-card:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.uf-cover {
    position: relative;
    width: 100%;
    height: 104px;
    background: var(--bg-tertiary);
}

.uf-cover-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0.5;
}

/* 非预览类型在图标下角补一个扩展名，一屏 docx/xlsx/zip 才分得开 */
.uf-ext {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.uf-thumb {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.uf-card.is-thumb-loaded .uf-thumb {
    opacity: 1;
}

/* 封面签不出来 / 加载失败时 JS 摘掉 is-cover，露出占位图标而不是裂图 */
.uf-card:not(.is-cover) .uf-thumb {
    display: none;
}

.uf-play {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    display: none;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-overlay);
    font-size: 10px;
    color: var(--text-on-accent);
    pointer-events: none;
}

.uf-card.is-video.is-cover.is-thumb-loaded .uf-play {
    display: block;
}

.uf-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    gap: 1px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.uf-card:hover .uf-actions,
.uf-card:focus-within .uf-actions {
    opacity: 1;
}

.uf-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 4px;
    border: none;
    background: var(--surface-overlay);
    color: var(--text-on-accent);
    /* 半透明条会压在任意底色的封面上，加一层描边保证浅色图上也读得清 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    font-size: 11px;
    line-height: 16px;
    cursor: pointer;
}

.uf-action:hover {
    background: var(--accent-primary);
}

.uf-action:disabled {
    opacity: 0.6;
    cursor: default;
}

.uf-action-text {
    white-space: nowrap;
}

.uf-name {
    padding: 6px 8px 0;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-primary);
    word-break: break-all;
    /* 文件名两行封顶：再长就把卡片撑得高矮不齐 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.uf-meta {
    padding: 2px 8px 8px;
    font-size: 10px;
    line-height: 14px;
    color: var(--text-muted);
}

.uf-status {
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.uf-status-error {
    color: var(--accent-danger);
}

.uf-more-row {
    display: flex;
    justify-content: center;
    padding: 16px 0 4px;
}

/* 触屏设备没有 hover，「悬停才出现的按钮」等于点不到：
   按钮改成常驻，并撑到 44px 最小热区；封面同步加高，让出这一条的位置。 */
@media (hover: none) {
    .uf-cover {
        height: 132px;
    }

    .uf-actions {
        opacity: 1;
    }

    .uf-action {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .uf-grid {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 10px;
    }
}

/* ===================================================================
   作品（#/works）
   -------------------------------------------------------------------
   列表卡片**不在这里**：它整套复用应用列表的 .apps-card-grid / .app-card
   （见 js/works.js 顶部注释），所以这一段只补应用卡片没有的那几件东西——
   简介行、工序进度条，以及详情页那一整套结构化展示。

   颜色一律走 themes.css 的变量，warm / dark 两套都靠变量自动成立，
   不要在这里写死十六进制。
   =================================================================== */

.work-card-summary {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    /* 简介长度不可控，卡片高度得可预期：两行封顶，多的省略号收掉 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 工序进度条。「越靠前越便宜」是这套工序的核心，所以列表页就要看得见走到哪一步了 */
.work-card-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.work-progress-track {
    height: 4px;
    border-radius: 3px;
    background: var(--surface-inset, var(--bg-tertiary));
    overflow: hidden;
}

.work-progress-track > i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--accent-primary);
    transition: var(--transition);
}

.work-progress-text {
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------- 详情页头部 ---------- */

.work-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.work-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-detail-summary {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* 工序步骤条。7 步在窄屏上必然放不下一行，所以是 wrap 而不是横向滚动
   （带内容的横滚等于「后面几步永远在屏幕外」）。 */
.work-stage-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-stage-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.work-stage-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.work-stage-step.is-done {
    color: var(--text-secondary);
}

.work-stage-step.is-done .work-stage-dot {
    border-color: color-mix(in srgb, var(--accent-success) 34%, transparent);
    background: color-mix(in srgb, var(--accent-success) 13%, var(--surface-panel));
    color: var(--accent-success);
}

.work-stage-step.is-current {
    color: var(--accent-primary);
    font-weight: 600;
}

.work-stage-step.is-current .work-stage-dot {
    border-color: color-mix(in srgb, var(--accent-primary) 34%, transparent);
    background: color-mix(in srgb, var(--accent-primary) 13%, var(--surface-panel));
    color: var(--accent-primary);
}

/* ---------- 详情页左右布局 ---------- */

/* 刻意不复用向导的 .wizard-layout：那套是给高度已经定死的弹窗写的
   （flex: 1 + overflow: hidden），放进 .view 里 flex 不起作用、还会裁掉内容。 */
.work-detail-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* 左侧竖向 Tab 列 */
.work-detail-tabs {
    display: flex;
    flex-direction: column;
    flex: 0 0 168px;
    gap: 4px;
    padding: 8px 0;
    border-right: 1px solid var(--line-soft, var(--border-color));
}

/* 每个 Tab **必须是块级并撑满这一列**。早先借用向导的 .wizard-sidebar-tab，
   那份样式只写了 padding 和左边框、没写 display / width，<button> 默认按内容收缩，
   四个 Tab 就横着折成 2×2 的小方块——「竖向 tab 列变成方格」就是这么来的。 */
.work-tab {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.work-tab:hover {
    background: var(--surface-hover, var(--bg-tertiary));
    color: var(--text-primary);
}

.work-tab.active {
    border-left-color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    color: var(--accent-primary);
    font-weight: 600;
}

.work-detail-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- Tab 内容：结构化展示 ---------- */

.work-section + .work-section {
    margin-top: 24px;
}

.work-section-title {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line-soft, var(--border-color));
    color: var(--text-heading, var(--text-primary));
    font-size: 15px;
    font-weight: 600;
}

/* 字段表：左标签右值。作品的内容本来就是结构化的，这里就按结构摆，
   不要拍平成一段自由文本。 */
.work-fields {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.work-field {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft, var(--border-color));
}

.work-field:last-child {
    border-bottom: 0;
}

.work-field dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.work-field dd {
    margin: 0;
    min-width: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.work-notes {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.7;
}

/* 分话列表 */
.work-episodes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.work-episode {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft, var(--border-color));
    border-radius: 8px;
    background: var(--surface-panel, var(--bg-card));
}

.work-episode-index {
    flex: none;
    min-width: 22px;
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.work-episode-title {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-episode-count {
    flex: none;
    color: var(--text-muted);
    font-size: 12px;
}

/* 设定集：卡片墙。图只是让人认出是哪张卡，锁定措辞才是本体，所以文字不截断。 */
.work-lock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.work-lock-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-soft, var(--border-color));
    border-radius: 8px;
    background: var(--surface-panel, var(--bg-card));
    overflow: hidden;
}

.work-lock-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
    background: var(--surface-panel-muted, var(--bg-tertiary));
}

.work-lock-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-lock-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.work-lock-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.work-lock-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.work-media-empty {
    padding: 8px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* 分镜：一话一组的缩略图墙，明细收进弹窗。
   这一屏用户只做两件事——看画面对不对、找到某一格。原先把每一格的全部字段平铺成
   一长列，两件事都干不成：图小得看不清，字多得找不到。所以图当主体、字退到弹窗。 */
.work-panel-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--line-soft, var(--border-color));
    background: transparent;
    color: var(--text-heading, var(--text-primary));
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.work-panel-group-head:hover {
    color: var(--accent-primary);
}

/* 折叠指示用纯 CSS 三角，不引图标库（docs/frontend.md：图标只用 emoji 或内联 SVG） */
.work-panel-group-caret {
    flex: none;
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transform: rotate(90deg);
    transition: var(--transition);
}

.work-panel-group.is-collapsed .work-panel-group-caret {
    transform: rotate(0deg);
}

.work-panel-group.is-collapsed .work-panel-grid {
    display: none;
}

.work-panel-group-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-panel-group-count {
    flex: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.work-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.work-panel-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line-soft, var(--border-color));
    border-radius: 8px;
    background: var(--surface-panel, var(--bg-card));
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.work-panel-tile:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 34%, transparent);
    box-shadow: var(--elevation-1, var(--shadow-sm));
}

.work-panel-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.work-panel-index {
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* 摘要两行封顶：格子的作用是让人认出「是哪一格」，不是在这里读完 */
.work-panel-tile-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.work-panel-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: var(--surface-panel-muted, var(--bg-tertiary));
    overflow: hidden;
}

.work-panel-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-panel-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* 单格弹窗：走公共 #modal，这里只定这一格的内容排布 */
.modal.modal-work-panel {
    max-width: 720px;
}

.work-panel-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.work-panel-detail-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    background: var(--surface-panel-muted, var(--bg-tertiary));
    overflow: hidden;
}

.work-panel-detail-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.work-panel-detail-fields {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.work-panel-detail-fields .work-fields {
    width: 100%;
}

.work-panel-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft, var(--border-color));
}

.work-panel-detail-nav .btn-secondary:disabled {
    opacity: 0.45;
    cursor: default;
}

.work-panel-detail-position {
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* 成片：直接给播放器。列一行文件名等于让用户再猜一次「点哪里能播」。 */
.work-output-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.work-output-item {
    margin: 0;
}

.work-output-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line-soft, var(--border-color));
    border-radius: 8px;
    background: var(--surface-inset, var(--bg-tertiary));
}

.work-output-caption {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    word-break: break-all;
}

/* 窄屏：左右两栏改成上下，Tab 列横过来铺满一行并换行——
   带内容的横向滚动条等于「后面的 Tab 永远在屏幕外」，不用 overflow-x。 */
@media (max-width: 768px) {
    .work-detail-layout {
        flex-direction: column;
        gap: 12px;
    }

    .work-detail-tabs {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft, var(--border-color));
    }

    .work-tab {
        width: auto;
        min-height: 44px;
        border-left: 0;
        border-bottom: 2px solid transparent;
        border-radius: 6px;
    }

    .work-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent-primary);
    }

    .work-field {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    /* 分镜在窄屏上仍然是缩略图墙，只是每行少放几个：图就是这一屏的内容本身，
       藏掉它等于把这一屏变成一列没有画面的文字（旧版就是这么做的，找不到任何一格）。 */
    .work-panel-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    }

    .work-panel-group-head {
        min-height: 44px;
    }

    /* 弹窗里图和字改成上下：并排两栏在手机上等于两栏都读不了 */
    .work-panel-detail {
        grid-template-columns: 1fr;
    }

    .work-lock-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .work-output-list {
        grid-template-columns: 1fr;
    }
}
