/*
 * @File: app.css
 * @Description: 全局基础样式，定义道奇蓝主色调变量、排版、按钮、表单、表格与通用组件
 * @Author: Junwen
 * @Email: 565897782@qq.com
 * @Contact: WeChat:Awoowo
 * @Version: 2.0.0
 * @Date: 2026-09-22
 * @Copyright: Copyright (c) 2026 Junwen All rights reserved.
 */

:root {
    --brand: #1E90FF;
    --brand-strong: #187BCD;
    --brand-dark: #14639F;
    --brand-soft: #E8F3FF;
    --brand-line: #B6DBFF;

    --text: #1F2937;
    --text-sub: #5B6B7F;
    --text-mute: #8A97A6;
    --line: #E5EAF0;
    --bg: #F5F7FA;
    --panel: #FFFFFF;
    --panel-sub: #FAFCFF;

    --ok: #18A058;
    --warn: #E8A33D;
    --danger: #E54545;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(31, 41, 55, .08);
    --shadow: 0 4px 16px rgba(31, 41, 55, .10);
    --shadow-lg: 0 12px 36px rgba(31, 41, 55, .16);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.65;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

h1, h2, h3, h4, h5, h6 { margin: 0 0 12px; font-weight: 600; line-height: 1.4; }
p { margin: 0 0 10px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--text); }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }

.btn-info { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.btn-info:hover { background: #D6EAFF; border-color: var(--brand); color: var(--brand-dark); }

.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #CE3A3A; border-color: #CE3A3A; color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- 表单 ---------- */
.form-item { display: block; margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-sub); font-weight: 500; }
.form-help { display: block; margin-top: 5px; font-size: 12px; color: var(--text-mute); font-style: normal; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { height: auto; padding: 10px 12px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, .14);
}

/* ---------- 卡片 ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.panel-body { padding: 18px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: var(--panel-sub); color: var(--text-sub); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: var(--panel-sub); }
.table-empty { padding: 40px 0; text-align: center; color: var(--text-mute); }

/* ---------- 标签 ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1;
}
.tag-ok { background: #E7F6EE; color: var(--ok); }
.tag-bad { background: #FDECEC; color: var(--danger); }
.tag-warn { background: #FDF2E3; color: var(--warn); }
.tag-info { background: var(--brand-soft); color: var(--brand-dark); }
.tag-mute { background: #F0F3F7; color: var(--text-sub); }

/* ---------- 提示框（居中） ---------- */
.toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 200px;
    max-width: 680px;
    max-height: 60vh;
    overflow: auto;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--panel);
    box-shadow: var(--shadow);
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
    animation: toast-in .22s ease;
}
.toast span { display: block; }
.toast.is-out { animation: toast-out .2s ease forwards; }
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--danger); }
.toast-warn { border-left-color: var(--warn); }
.toast i { font-size: 15px; }
.toast-success i { color: var(--ok); }
.toast-error i { color: var(--danger); }
.toast-warn i { color: var(--warn); }
.toast-info i { color: var(--brand); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- 弹窗（居中） ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(24, 34, 48, .48);
    animation: fade-in .18s ease;
}
.modal {
    width: 100%;
    max-width: 520px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: modal-in .2s ease;
}
.modal-lg { max-width: 760px; }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 600;
}
.modal-head .modal-close {
    border: none;
    background: transparent;
    color: var(--text-mute);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.modal-head .modal-close:hover { color: var(--brand); }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 0; }
.pager a, .pager span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-sub);
    font-size: 13px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 极简页 ---------- */
.page-blank { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.blank-shell { width: 100%; max-width: 420px; padding: 0 16px; }
.notice-box {
    padding: 40px 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.notice-icon { display: block; font-size: 46px; color: var(--brand); margin-bottom: 14px; }
.notice-box p { color: var(--text-sub); }
.notice-action { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- Markdown 排版 ---------- */
.md-h1, .md-h2, .md-h3, .md-h4, .md-h5, .md-h6 { margin: 22px 0 12px; line-height: 1.4; }
.md-h1 { font-size: 24px; }
.md-h2 { font-size: 20px; padding-left: 10px; border-left: 4px solid var(--brand); }
.md-h3 { font-size: 17px; }
.md-h4 { font-size: 15px; }
.md-p { margin: 0 0 14px; }
.md-ul, .md-ol { margin: 0 0 14px; padding-left: 22px; }
.md-ul li, .md-ol li { margin-bottom: 6px; }
.md-quote {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--brand);
    background: var(--brand-soft);
    color: var(--text-sub);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md-pre {
    margin: 0 0 14px;
    padding: 14px 16px;
    background: #F7F9FC;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px;
}
.md-code {
    padding: 2px 6px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 4px;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px;
}
.md-hr { margin: 22px 0; border: none; border-top: 1px solid var(--line); }

/* ---------- 部署自检 ---------- */
.deploy-check { margin-top: 16px; border-top: 1px solid var(--line); }
.deploy-check .pane-tip { color: var(--danger); }
.deploy-check.is-flush { margin-top: 0; border-top: 0; }
.deploy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.deploy-row:last-of-type { border-bottom: 0; }
.deploy-name { color: var(--text-sub); flex: none; }
.deploy-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    text-align: right;
}
.deploy-path {
    font-style: normal;
    color: var(--text-mute);
    font-size: 12px;
    word-break: break-all;
}

/* ---------- 工具 ---------- */
.text-mute { color: var(--text-mute); }
.text-sub { color: var(--text-sub); }
.text-brand { color: var(--brand); }
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }
.mb10 { margin-bottom: 10px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
