/* ===== 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;
}

.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: 12px;
    padding: 10px 0 0;
    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);
}

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

.sidebar-header .logo-trademark-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 172px;
    height: 42px;
    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: 16px 12px;
}

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

.sidebar-recent-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 6px 8px;
    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: 8px 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;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: 4px;
}

.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: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user-panel {
    margin-bottom: 12px;
    padding: 10px 10px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.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: 12px;
    padding: 4px 2px;
    background: transparent;
    border-radius: 0;
}

.user-avatar {
    font-size: 20px;
}

.btn-logout {
    width: 100%;
    padding: 10px 10px 10px 34px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-align: left;
    transition: var(--transition);
}

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

/* ===== 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);
}

/* 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);
}

.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-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
    gap: 20px;
    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-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;
}

.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;
}

/* 用户信息卡片 */
.profile-user-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(46, 200, 184, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(22, 27, 34, 0.98), rgba(28, 33, 40, 0.94));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.profile-user-card:hover {
    border-color: rgba(46, 200, 184, 0.3);
    box-shadow: var(--shadow-md);
}

.profile-user-avatar-wrap {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(46, 200, 184, 0.15), rgba(199, 123, 43, 0.1));
    border: 1px solid rgba(46, 200, 184, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.profile-user-info {
    flex: 1;
    min-width: 0;
}

.profile-user-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.profile-user-name-row {
    margin-bottom: 10px;
}

.profile-user-name-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.profile-user-name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-user-name-input {
    flex: 1;
    min-width: 160px;
    max-width: 280px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(48, 54, 61, 0.88);
    background: rgba(13, 17, 23, 0.55);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.profile-user-name-input:focus {
    outline: none;
    border-color: rgba(46, 200, 184, 0.55);
    box-shadow: 0 0 0 3px rgba(46, 200, 184, 0.12);
}

.profile-username-tip {
    margin-top: 6px;
    min-height: 18px;
    font-size: 12px;
    color: var(--text-muted);
}

.profile-username-tip.is-error {
    color: #f85149;
}

.profile-username-tip.is-success {
    color: #3fb950;
}

.profile-user-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-user-id-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-user-id-value {
    font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    background: rgba(46, 200, 184, 0.1);
    border: 1px solid rgba(46, 200, 184, 0.2);
    padding: 2px 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;
}
@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;
    margin-bottom: 24px;
}

@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);
}

.my-models-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.my-models-enabled-toggle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.my-models-enabled-toggle input:checked + span {
    color: var(--accent-success, #3fb950);
}

.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);
}

/* 订单状态徽标 */
.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;
}

.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;
}

/* ===== 侧栏 人工客服 入口（用户） ===== */

.sidebar-feedback-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-feedback-btn:hover {
    background: var(--bg-card);
    border-color: rgba(46, 200, 184, 0.45);
    color: var(--text-primary);
}

.sidebar-feedback-btn.active {
    background: rgba(46, 200, 184, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sidebar-feedback-icon {
    font-size: 16px;
}

/* ===== 人工客服页面（普通用户） ===== */

.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,
.sidebar-feedback-btn: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;
}

/* 未登录「使用案例」里它是卡片容器的第一个元素，上方没有一级 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;
}

.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);
}

/* 对话历史 */
.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 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.share-blog-columns .form-group {
    min-width: 0;
}

.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 画廊卡片（瀑布流）--
   图片分享只看图：卡片上没有标题、作者和日期，只有图本身加压在图上的点赞 /
   收藏 / 评论数，其余信息都在详情页。

   排版用 CSS 多列（column-width）做瀑布流而不是等高网格：图片比例千差万别，
   固定 4:3 网格要么裁掉半张图，要么把竖图压成一条。多列布局让每张图按原始比例
   完整展示，列数由容器宽度和 --image-card-col 自己算出来（手机上收窄成两列）。
   代价是阅读顺序变成「先竖着排满一列再到下一列」，画廊场景可以接受。 */
.image-card-grid {
    --image-card-col: 240px;
    /* 用 column-width 而不是 column-count：列数由容器宽度自己算，
       容器比列宽还窄时浏览器直接给一列（列宽退回容器宽度），不会溢出。 */
    column-width: var(--image-card-col);
    column-gap: 16px;
}

/* 手机上按 240px 列宽只能排一列，一张竖图就要占掉一整屏；收窄列宽换成两列，
   与常见图片流的浏览习惯一致。 */
@media (max-width: 640px) {
    .image-card-grid {
        --image-card-col: 150px;
        column-gap: 12px;
    }

    .image-card {
        margin-bottom: 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 {
    column-span: all;
}

.image-card {
    display: block;
    /* 多列布局会把元素从中间劈到下一列，卡片必须整块不可断
       （老 Safari 只认 -webkit- 前缀那条） */
    -webkit-column-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 16px;
    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-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;
}

/* -- 图片分享详情：原图 + 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);
}

.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;
}

/* 高度跟视口走：矮屏（如 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);
}

/* 标题右侧的「已选 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;
}

/* 不要在这里写 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;
    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;
}

.lp-nav-link {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-subtle);
    font-size: 14px;
    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;
}

.lp-nav-actions {
    display: flex;
    align-items: center;
    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-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

/* 条目前面只留一条强调色短线当记号，不放小图标 */
.lp-hero-points li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-body);
}

.lp-hero-points li::before {
    content: '';
    flex: none;
    width: 14px;
    height: 1px;
    transform: translateY(-0.4em);
    background: var(--accent-primary);
}

.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-care-grid {
    display: grid;
    /* 六项，用 300px 起跳的列宽在宽屏上排成 3 + 3，避免末行只剩两张显得残缺 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4px 36px;
}

/* 这六项是"你不用管的事"，不是卖点卡片：去掉卡片外壳，只留一条顶线，
   排成规格表的样子。和上面六张实心卡片拉开层级，整页也不会被卡片塞满。 */
.lp-care-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0 22px;
    border-top: 1px solid var(--line-default);
    background: none;
}

.lp-care-title {
    font-size: 14px;
    font-weight: 640;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

.lp-care-desc {
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-subtle);
}

/* 区块内部的次级小标题：一条短横线 + 一行字，比 section-title 轻一档，
   用来把并进同一区块的两组内容分开，而不必再开一个 section。 */
.lp-subhead {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 52px 0 10px;
    font-size: 15px;
    font-weight: 640;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

.lp-subhead-rule {
    flex: none;
    width: 22px;
    height: 1px;
    background: 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;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.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;
}

.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);
    text-align: left;
    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-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;
        overflow-x: auto;
    }

    .lp-nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }

    .lp-main {
        padding: 0 16px 56px;
    }

    .lp-section {
        margin-top: 60px;
    }

    .lp-care-grid {
        gap: 0 36px;
    }

    .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-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;
    }
}

