.hidden { display: none !important; }
.newline { display: block; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: #f2f2f2;
    min-height: 100vh;
    color: #222;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* 顶栏 */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0;
    background: #1a1a1a;
    z-index: 101;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px;
    height: 46px;
}
.top-nav-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { background: none; border: none; font-size: 16px; color: #999; cursor: pointer; padding: 6px 4px; border-radius: 4px; transition: color 0.2s; }
.sidebar-toggle:hover { color: #fff; }
.top-nav-title { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 1px; }
.top-nav-right { display: flex; align-items: center; gap: 14px; }
.top-nav-balance { color: #ffd43b; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
.top-nav-rate { color: #aaa; font-size: 12px; }
.top-nav-key { color: #888; font-size: 11px; font-family: "SF Mono", "Consolas", monospace; }
.logout-btn { color: #999; font-size: 12px; cursor: pointer; text-decoration: none; padding: 4px 10px; border-radius: 4px; transition: all 0.2s; }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* 侧边栏 */
.sidebar {
    position: fixed; left: -220px; top: 0; bottom: 0; width: 200px;
    background: #fff;
    z-index: 100;
    display: flex; flex-direction: column;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}
.sidebar.active { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.08); }
.sidebar-header { padding: 18px 0; text-align: center; border-bottom: 1px solid #eee; }
.sidebar-title { font-size: 13px; font-weight: 500; color: #999; letter-spacing: 2px; text-transform: uppercase; }
.sidebar-menu { display: flex; flex-direction: column; flex: 1; padding: 8px 0; overflow-y: auto; }
.menu-item { display: flex; align-items: center; padding: 12px 20px; margin: 1px 12px; color: #666; text-decoration: none; font-size: 13px; border-radius: 6px; cursor: pointer; transition: all 0.15s; position: relative; }
.menu-item:hover { background: #f8f8f8; color: #111; }
.menu-item.active { background: #f5f5f5; color: #111; font-weight: 600; }
.menu-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: #222; border-radius: 0 2px 2px 0; }
.menu-item i { width: 18px; text-align: center; font-size: 14px; margin-right: 10px; }

/* 遮罩 */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* 主内容 */
.main-content { margin-left: 0; padding: 62px 16px 20px; max-width: 1200px; margin-left: auto; margin-right: auto; }

/* 卡片 */
.card {
    background: #fff; border-radius: 8px; padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 16px;
}

/* 标题 */
.section-title {
    font-size: 16px; font-weight: 700; color: #111;
    margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px;
    padding-bottom: 14px; border-bottom: 1px solid #eee; flex-wrap: wrap;
}
.section-title i { color: #555; background: transparent; padding: 0; font-size: 16px; margin-top: 2px; }

/* 公告 */
.announcement-item { background: #fafafa; border-radius: 6px; padding: 16px; margin-bottom: 12px; border: none; }
.announcement-item:hover { background: #f5f5f5; }
.announcement-title { font-size: 15px; font-weight: 600; color: #111; margin-bottom: 8px; }
.announcement-content { color: #555; font-size: 14px; line-height: 1.7; }
.announcement-date { color: #bbb; font-size: 12px; margin-top: 10px; }

/* 查询/日期区域 */
.query-section, .date-section { background: #fafafa; border-radius: 6px; padding: 18px; margin-bottom: 16px; }

/* 输入组 */
.input-group { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.input-group.vertical { flex-direction: column; gap: 12px; }
.input-group.nowrap { flex-wrap: nowrap; }

label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

input, textarea, select {
    padding: 10px 14px; border: 1px solid #e5e5e5;
    border-radius: 6px; font-size: 14px; background: #fff;
    outline: none; width: 100%; transition: border-color 0.2s;
    color: #222;
}
input:focus, textarea:focus, select:focus { border-color: #333; }
input[type="date"] { text-align: center; }
input::placeholder, textarea::placeholder { color: #ccc; }

/* 按钮 */
.btn {
    padding: 8px 18px; border: none; border-radius: 6px;
    font-weight: 600; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.15s; white-space: nowrap; letter-spacing: 0.3px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: #111; color: #fff; }
.btn-primary:hover { background: #333; }
.btn-success { background: #16a34a; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-warning { background: #d97706; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 5px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 4px; font-weight: 500; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; color: #666; border: 1px solid #e5e5e5; }
.btn-ghost:hover { background: #fafafa; border-color: #ccc; }

/* 查询结果 */
.query-result { background: #f9f9f9; border-radius: 6px; padding: 16px; margin-bottom: 16px; border: none; }
.info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.info-item { background: #fff; padding: 14px; border-radius: 6px; text-align: center; border: 1px solid #f0f0f0; }
.info-label { color: #bbb; font-size: 11px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-value { color: #111; font-weight: 600; font-size: 15px; }

/* 费用预览 */
.cost-preview {
    background: #fafafa; border-radius: 6px; padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; border: none;
}
.cost-label { color: #888; font-size: 13px; }
.cost-amount { font-size: 24px; font-weight: 700; color: #111; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th { background: #fafafa; padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 600; color: #888; border-bottom: 1px solid #eee; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; font-size: 13px; color: #333; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* 状态标签 */
.status-badge { padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; white-space: nowrap; }
.status-active { background: #ecfdf5; color: #059669; }
.status-paused { background: #fef2f2; color: #dc2626; }
.status-expired { background: #f5f5f5; color: #888; }
.status-pending { background: #fffbeb; color: #d97706; }

/* 操作按钮 */
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 24px; width: 380px; max-width: 92%; box-shadow: 0 8px 32px rgba(0,0,0,0.12); position: relative; }
.modal-title { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 20px; text-align: center; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* 确保日期选择器在模态框中正常工作 */
.modal-box input[type="date"] {
    cursor: pointer;
    background-color: #fff;
}
.modal-box input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
}
.modal-box input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 提示 */
.toast-container { position: fixed; top: 56px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 6px; color: #fff; font-weight: 500; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateX(120%); opacity: 0; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; max-width: 320px; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hiding { transform: translateX(120%); opacity: 0; }
.toast-success { background: #111; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
.toast-warning { background: #d97706; }

/* 空状态 */
.empty-state { text-align: center; padding: 40px 20px; color: #ccc; }
.empty-state i { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* 消息 */
.msg { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; border-left: 3px solid; }
.msg-success { background: #f9faf9; border-color: #16a34a; color: #16a34a; }
.msg-error { background: #fef2f2; border-color: #dc2626; color: #dc2626; }

/* 面板切换 */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #111; padding: 20px; }
.login-box { background: #1a1a1a; border-radius: 8px; padding: 48px 36px; width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 48px; height: 48px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.login-logo i { font-size: 20px; color: #111; }
.login-title { font-size: 20px; color: #fff; margin-bottom: 8px; font-weight: 600; letter-spacing: 1px; }
.login-subtitle { color: #666; font-size: 13px; margin-bottom: 36px; }
.login-error { background: rgba(220,38,38,0.15); color: #ef4444; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; font-size: 13px; }
.login-input { width: 100%; padding: 14px 16px; border: 1px solid #333; border-radius: 6px; font-size: 16px; text-align: center; letter-spacing: 4px; background: #222; color: #fff; margin-bottom: 20px; }
.login-input:focus { border-color: #fff; background: #2a2a2a; }
.login-input::placeholder { color: #555; letter-spacing: 2px; }
.login-tip { margin-top: 24px; font-size: 11px; color: #444; }

/* 加载动画 */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* 手机端 - 和电脑端完全一致的黑白风格，文字更大 */
@media (max-width: 768px) {
    .top-nav { padding: 0 14px; height: 46px; }
    .top-nav-title { font-size: 15px; }
    .top-nav-key { display: none; }
    .top-nav-rate { display: none; }
    .top-nav-balance { font-size: 14px; }
    .sidebar { width: 200px; left: -220px; }
    .sidebar.active { box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
    .main-content { padding: 56px 10px 14px; max-width: 100%; }
    .card { padding: 16px; border-radius: 8px; margin-bottom: 12px; }
    .section-title { font-size: 16px; margin-bottom: 16px; padding-bottom: 12px; }
    .input-group { flex-direction: column; gap: 10px; }
    .input-group.nowrap { flex-direction: row; }
    .info-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
    .info-item { padding: 12px; }
    .info-label { font-size: 12px; }
    .info-value { font-size: 16px; }
    table { min-width: 440px; }
    th, td { padding: 10px 12px; font-size: 13px; }
    th { font-size: 11px; }
    .cost-amount { font-size: 22px; }
    .cost-label { font-size: 14px; }
    .query-section, .date-section { padding: 14px; }
    input, textarea, select { padding: 12px 14px; font-size: 15px; }
    label { font-size: 13px; }
    .btn { padding: 10px 18px; font-size: 14px; }
    .btn-sm { padding: 7px 14px; font-size: 13px; }
    .btn-xs { padding: 5px 10px; font-size: 12px; }
    .toast-container { top: 52px; right: 10px; left: 10px; }
    .toast { font-size: 14px; padding: 11px 14px; max-width: 100%; }
    .login-box { padding: 36px 24px; }
    .login-input { font-size: 16px; padding: 14px 16px; letter-spacing: 3px; }
    .announcement-title { font-size: 15px; }
    .announcement-content { font-size: 14px; }
    .secret-key { font-size: 11px; padding: 4px 8px; }
    .logout-btn { font-size: 13px; padding: 5px 10px; }
    .action-buttons { gap: 5px; }
    .menu-item { padding: 14px 20px; font-size: 14px; }
    .modal-title { font-size: 17px; }
    .modal-box { padding: 28px; }
    .empty-state { padding: 48px 20px; }
    .empty-state i { font-size: 44px; }
    .empty-state p { font-size: 15px; }
    .msg { font-size: 14px; padding: 13px 16px; }
    .announcement-date { font-size: 13px; }
}
