/* ============================================
   通用样式 common.css
   跨模块共享：基础布局 / 页头页脚 / 登录页 / Toast / 通用按钮 /
   状态徽章 / 全局响应式
   ============================================ */

/* ==============================
   市场调研系统 - 全局样式
   ============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   设计令牌 (Design Tokens) - 极简清爽
   统一色板 / 阴影 / 圆角 / 缓动
   ============================================ */
:root {
    /* ==== v2 品牌色板（政企级清晰） ==== */
    --c-brand-900: #12294d;
    --c-brand-700: #1b3a6b;
    --c-brand-500: #2563eb;
    --c-brand-100: #e8eef8;
    --c-gold: #c9a254;
    --c-gold-bg: #f7f1e3;

    /* 主色系（旧变量名 → 新品牌值，页面零改动焕新） */
    --c-primary: #1b3a6b;
    --c-primary-deep: #12294d;
    --c-primary-light: #3b5c8f;
    /* 强调色 - 仅保留蓝/绿/橙三色系 */
    --c-green: #16a34a;
    --c-green-light: #22c55e;
    --c-amber: #b45309;
    --c-amber-light: #f59e0b;
    --c-rose: #dc2626;

    /* 渐变 - 简化 */
    --grad-primary: linear-gradient(135deg, #1b3a6b, #12294d);

    /* 阴影 - 仅 2 级 */
    --sh-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --sh-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);

    /* 圆角 */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;

    /* 平滑缓动曲线 */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s var(--ease);
    --t-base: 0.25s var(--ease);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f6fa;
    color: #0f172a;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

.page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 40px;
    position: relative;
    z-index: 1;
}

/* 修复 iOS Safari 输入框缩放问题 */
@media screen and (max-width: 640px) {
    input, textarea, select, button {
        font-size: 16px !important;
    }
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    color: #1e293b;
    padding: 20px 20px 16px;
    margin: 0 -16px 20px;
    position: relative;
}

.header-inner {
    position: relative;
    z-index: 1;
}

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

.header-top h1 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
    flex: 1;
    min-width: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
}

.header-logout-btn {
    padding: 5px 14px;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-logout-btn:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.header-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #94a3b8;
}

/* ==============================
   保留原有 .form-actions（无分页时使用）
   ============================== */

/* Buttons */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.submit-btn,
.reset-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.submit-btn:active {
    transform: scale(0.97);
}

.reset-btn {
    background: #f5f5f5;
    color: #666;
}

.reset-btn:active {
    background: #eee;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 32px 0 20px;
    font-size: 13px;
    color: #999;
    line-height: 1.8;
}

/* Success / Error */
.success-box,
.error-box {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    margin-top: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: #16a34a;
    color: #fff;
    font-size: 36px;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}

.success-box h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #333;
}

.success-box p {
    font-size: 15px;
    color: #666;
}

.error-box h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: #e53935;
}

.error-box ul {
    list-style: none;
    color: #e53935;
    font-size: 14px;
    line-height: 2;
}

/* ==============================
   登录页面
   ============================== */

.login-page-body {
    background: #f7f8fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 背景装饰 - 极简模式，仅保留淡色 */
.login-bg-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.login-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
}

.login-bg-circle-1 {
    width: 500px;
    height: 500px;
    background: #2563eb;
    top: -160px;
    right: -120px;
}

.login-bg-circle-2 {
    width: 320px;
    height: 320px;
    background: #2563eb;
    bottom: -100px;
    left: -80px;
}

.login-bg-circle-3 {
    display: none;
}

/* 登录页面包裹 */
.login-page-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px 20px 40px;
}

/* Logo 区域 */
.login-logo-area {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeSlideUp 0.6s ease;
}

.login-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(26,115,232,0.18);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.login-logo-icon:hover {
    transform: scale(1.05);
}

.login-logo-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.login-site-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.5px;
}

.login-site-subtitle {
    font-size: 14px;
    color: #7a8ba3;
    font-weight: 400;
}

/* 登录卡片 */
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    animation: fadeSlideUp 0.5s ease;
    border: 1px solid #eef0f3;
}

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

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

/* 登录错误提示 */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fef1f1;
    border: 1px solid #fdcaca;
    border-radius: 12px;
    color: #c53030;
    font-size: 14px;
    margin-bottom: 20px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e53e3e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* 登录表单 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.login-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.login-label svg {
    color: #94a3b8;
}

.login-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e8edf2;
    border-radius: 12px;
    font-size: 15px;
    color: #2d3748;
    background: #fafbfc;
    transition: all 0.25s;
    outline: none;
}

.login-input::placeholder {
    color: #a0aec0;
}

.login-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.login-submit-btn {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

.login-submit-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.login-submit-btn:active {
    transform: scale(0.98);
}

.login-submit-btn svg {
    transition: transform 0.25s;
}

.login-submit-btn:hover svg {
    transform: translateX(4px);
}

/* 登录页 footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    font-size: 12px;
    color: #a0aec0;
    line-height: 1.8;
    animation: fadeSlideUp 0.8s ease;
}

/* 保留旧版兼容 */
.login-box {
    max-width: 400px;
    margin: 60px auto 0;
    background: #fff;
    border-radius: 16px;
    padding: 40px 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    text-align: center;
}

.login-box h1 {
    font-size: 22px;
    color: #2563eb;
    margin-bottom: 4px;
}

.login-box h2 {
    font-size: 16px;
    color: #666;
    font-weight: 400;
    margin-bottom: 28px;
}

.login-form {
    text-align: left;
}

.error-msg {
    background: #fce4e4;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: linear-gradient(135deg, rgba(38,42,56,0.96), rgba(28,32,44,0.96));
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: opacity var(--t-base), transform var(--t-base);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Empty */
.empty-notice {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

/* 分步动画 */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================
   状态徽章
   ============================== */

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

.status-badge-sm {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
}

.status-submitted {
    background: #e8f0fe;
    color: #2563eb;
}

.status-reviewing {
    background: #fef7e0;
    color: #e37400;
}

.status-approved {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-returned {
    background: #fce8e6;
    color: #c5221f;
}

.status-incomplete {
    background: #f0f0f0;
    color: #888;
}

.status-pending {
    background: #e8f0fe;
    color: #2563eb;
}

.status-closed {
    background: #f0f0f0;
    color: #999;
}

.status-default {
    background: #f0f2f5;
    color: #666;
}

.status-draft {
    background: #eff6ff;
    color: #2563eb;
}

/* 暂存草稿按钮 */
.save-draft-btn {
    flex: 1;
    max-width: 140px;
    padding: 12px 16px;
    border: 1.5px dashed #bfdbfe;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #eff6ff;
    color: #2563eb;
}

.save-draft-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.save-draft-btn:active {
    transform: scale(0.97);
}

.save-draft-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==============================
   全局布局 - 页面容器 / 页头 / 页脚
   ============================== */

.page-wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 32px; }

/* 站点头部导航 */
.site-header { background: #fff; border-bottom: 1px solid #eef0f3; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.header-inner { max-width: 960px; margin: 0 auto; padding: 14px 20px; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-top h1 { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0; }
.header-subtitle { font-size: 13px; color: #94a3b8; margin: 4px 0 0; }

/* 用户信息区 */
.header-user { display: flex; align-items: center; gap: 8px; }
.header-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.header-user-name { font-size: 14px; font-weight: 500; color: #334155; }
.header-logout-btn { font-size: 12px; color: #94a3b8; text-decoration: none; padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px; transition: all 0.15s; background: #f8fafc; }
.header-logout-btn:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

/* 页头（Logo/Brand区） */
.page-header { text-align: center; padding: 16px 0 8px; }
.page-header-row { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.page-logo { height: 40px; width: auto; max-height: 46px; max-width: 120px; object-fit: contain; flex-shrink: 0; }
.page-brand-name { font-size: 18px; font-weight: 700; color: #1a1a2e; }

/* 页脚 */
.site-footer { text-align: center; padding: 24px 20px; color: #999; font-size: 12px; border-top: 1px solid #eef0f3; margin-top: 32px; }
.site-footer p { margin: 4px 0; }
.footer-beian { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.footer-beian-link, .footer-wangan-link { color: #999; text-decoration: none; transition: color 0.15s; }
.footer-beian-link:hover, .footer-wangan-link:hover { color: #2563eb; }
.wangan-icon { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }

/* 页脚语言切换 - 下拉选择器 */
.footer-locale-dropdown { position: relative; display: inline-block; margin-top: 12px; }
.footer-locale-trigger { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: transparent; border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; color: #999; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.footer-locale-trigger:hover { color: #2563eb; border-color: #d0d8e8; background: #f8faff; }
.footer-locale-arrow { font-size: 10px; opacity: 0.6; transition: transform 0.2s; }
.footer-locale-menu { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); min-width: 150px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.12); border: 1px solid #e8ecf2; z-index: 1000; overflow: hidden; }
.footer-locale-menu.show { display: block; }
.footer-locale-option { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px; color: #333; text-decoration: none; transition: background 0.15s; }
.footer-locale-option:hover { background: #f5f7fa; text-decoration: none; }
.footer-locale-option.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.footer-locale-check { color: #2563eb; font-weight: 700; font-size: 12px; margin-left: auto; }

/* ==============================
   用户登录页 (user/login.php)
   ============================== */

.login-page-body { min-height: 100vh; background: #f7f8fa; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-page-body body { background: transparent; }

.login-bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.login-bg-circle { position: absolute; border-radius: 50%; opacity: 0.04; }
.login-bg-circle-1 { width: 500px; height: 500px; background: #2563eb; top: -160px; right: -120px; }
.login-bg-circle-2 { width: 320px; height: 320px; background: #2563eb; bottom: -100px; left: -80px; }
.login-bg-circle-3 { display: none; }

.login-page-wrap { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.login-logo-area { text-align: center; margin-bottom: 28px; }
.login-logo-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-logo-img { height: 44px; width: auto; max-height: 48px; max-width: 120px; object-fit: contain; flex-shrink: 0; }
.login-logo-icon { width: 48px; height: 48px; margin: 0; border-radius: 12px; flex-shrink: 0; }
.login-logo-icon svg { width: 100%; height: 100%; }
.login-site-title { font-size: 22px; font-weight: 700; color: #1a1a2e; margin: 0; }
.login-site-subtitle { font-size: 14px; color: #888; margin-top: 6px; }

.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04); border: 1px solid #eef0f3; }

.login-error { display: flex; align-items: center; gap: 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: #dc2626; }
.login-error-icon { width: 22px; height: 22px; border-radius: 50%; background: #dc2626; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

.login-form { display: flex; flex-direction: column; gap: 0; }
.login-field { margin-bottom: 18px; }
.login-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.login-label svg { color: #2563eb; }
.login-input { width: 100%; padding: 11px 14px; border: 1.5px solid #e0e4ea; border-radius: 10px; font-size: 14px; color: #333; outline: none; transition: all 0.2s; font-family: inherit; background: #fafcfd; }
.login-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); background: #fff; }
.login-input::placeholder { color: #c0c4cc; }

.login-pwd-wrap { position: relative; display: flex; align-items: center; }
.login-pwd-wrap .login-input { padding-right: 44px; }
.login-pwd-eye { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 18px; padding: 6px 10px; color: #94a3b8; line-height: 1; z-index: 2; border-radius: 0 10px 10px 0; transition: color 0.2s; }
.login-pwd-eye:hover { color: #475569; }

.login-submit-btn { width: 100%; padding: 13px 28px; background: #2563eb; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 3px rgba(37,99,235,0.3); margin-top: 4px; }
.login-submit-btn:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.login-submit-btn:active { transform: scale(0.98); }

.login-footer { text-align: center; padding: 20px; color: #bbb; font-size: 12px; }
.login-footer p { color: #bbb; }

/* ============================================
   H5 自适应增强 · 桌面 / 宽屏断点
   移动端保持手机 H5 单列；PC 端逐级拓宽容器与卡片
   （覆盖上方 .page-wrap 基准 max-width:960px）
   ============================================ */
@media (min-width: 768px) {
    .page-wrap { max-width: 1080px; padding: 24px 24px 48px; }
    .header-inner { max-width: 1080px; }
    .login-page-wrap { max-width: 440px; }
}
@media (min-width: 1200px) {
    .page-wrap { max-width: 1200px; }
    .header-inner { max-width: 1200px; }
}
@media (min-width: 1600px) {
    .page-wrap { max-width: 1320px; }
    .header-inner { max-width: 1320px; }
}

