/* ================= 翻译网门户 · 共享样式 ================= */
:root {
    --p-bg: #f4f5f7;
    --p-surface: #ffffff;
    --p-border: #e8e8e8;
    --p-border-light: #f0f0f0;
    --p-text: #1a1a1a;
    --p-text-secondary: #555555;
    --p-text-muted: #999999;
    --p-brand: #111111;
    --p-brand-hover: #333333;
    --p-accent: #2563eb;
    --p-danger: #e64545;
    --p-radius: 12px;
    --p-radius-lg: 16px;
    --p-shadow: 0 1px 3px rgba(0,0,0,0.05);
    --p-shadow-md: 0 4px 16px rgba(0,0,0,0.07);
    --header-h: 64px;
}
html.dark {
    --p-bg: #0a0a0a;
    --p-surface: #141414;
    --p-border: #262626;
    --p-border-light: #1d1d1d;
    --p-text: #f0f0f0;
    --p-text-secondary: #b0b0b0;
    --p-text-muted: #777777;
    --p-brand: #f0f0f0;
    --p-brand-hover: #ffffff;
    --p-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --p-shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    color-scheme: dark;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--p-bg); color: var(--p-text);
    line-height: 1.6; -webkit-font-smoothing: antialiased;
    transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- 页头 ---------- */
.portal-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
}
.portal-header .header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.portal-logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; flex-shrink: 0; }
.portal-logo-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: #111; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800;
}
html.dark .portal-logo-icon { background: #f0f0f0; color: #111; }
.portal-logo em { font-style: normal; }
.portal-nav { display: flex; gap: 4px; }
.portal-nav a { padding: 8px 13px; font-size: 15px; font-weight: 500; color: var(--p-text-secondary); border-radius: 8px; }
.portal-nav a:hover { color: var(--p-text); background: var(--p-bg); }
.portal-nav a.active { color: var(--p-text); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.theme-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--p-border); background: var(--p-surface);
    color: var(--p-text-secondary);
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.theme-toggle:hover { background: var(--p-bg); }
.portal-cta { padding: 9px 20px; border-radius: 999px; background: var(--p-brand); color: var(--p-surface); font-size: 14px; font-weight: 600; transition: background .2s; }
.portal-cta:hover { background: var(--p-brand-hover); }
html.dark .portal-cta { color: #111; }
.mobile-toggle { display: none; width: 40px; height: 40px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--p-text); border-radius: 2px; transition: all .3s; }
.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav { display: none; border-top: 1px solid var(--p-border); background: var(--p-surface); padding: 12px 24px 20px; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 0; font-size: 16px; font-weight: 500; color: var(--p-text-secondary); border-bottom: 1px solid var(--p-border-light); }

/* ---------- 页脚 ---------- */
.portal-footer { background: var(--p-surface); border-top: 1px solid var(--p-border); margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 48px 24px 32px; }
.footer-brand p { font-size: 13.5px; color: var(--p-text-muted); line-height: 1.8; margin-top: 12px; max-width: 300px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--p-text-muted); margin-bottom: 10px; }
.footer-col a:hover { color: var(--p-text); }
.footer-bottom { border-top: 1px solid var(--p-border-light); padding: 18px 24px; text-align: center; font-size: 13px; color: var(--p-text-muted); }

/* ---------- 页面标题带 ---------- */
.page-hero { padding: 36px 0 8px; }
.page-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; }
.page-hero h1::before { content: ''; width: 5px; height: 22px; border-radius: 3px; background: var(--p-brand); }
.page-hero p { margin-top: 8px; font-size: 15px; color: var(--p-text-muted); }

/* ---------- 通用卡片与按钮 ---------- */
.panel {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow);
    padding: 22px;
}
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 26px; border-radius: 10px;
    background: var(--p-brand); color: var(--p-surface);
    font-size: 14.5px; font-weight: 600; transition: background .2s;
}
.btn-primary:hover { background: var(--p-brand-hover); }
html.dark .btn-primary { color: #111; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px;
    border: 1px solid var(--p-border); color: var(--p-text-secondary);
    font-size: 14.5px; font-weight: 500; transition: all .2s;
    background: var(--p-surface);
}
.btn-ghost:hover { border-color: var(--p-text-muted); color: var(--p-text); }
textarea.area, input.inp, select.sel {
    width: 100%; border: 1px solid var(--p-border);
    background: var(--p-bg); color: var(--p-text);
    border-radius: 10px; padding: 12px 14px; font-size: 14.5px;
    transition: border-color .2s;
}
textarea.area:focus, input.inp:focus, select.sel:focus { border-color: var(--p-text-muted); }
textarea.area { min-height: 160px; resize: vertical; line-height: 1.8; }
.muted { color: var(--p-text-muted); font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

/* ---------- 进度条 ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--p-bg); overflow: hidden; margin-top: 14px; display: none; }
.progress.show { display: block; }
.progress i { display: block; height: 100%; width: 0; background: var(--p-accent); border-radius: 3px; transition: width .25s; }

/* ---------- Toast ---------- */
#toast {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
    background: var(--p-text); color: var(--p-bg);
    padding: 10px 22px; border-radius: 999px; font-size: 14px;
    opacity: 0; pointer-events: none; transition: all .3s; z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .portal-nav { display: none; }
    .mobile-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
