/* 盛泰地址查看器 - 浅色主题 */

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", Roboto, sans-serif;
    font-size: 14px;
    color: #1f2328;
    background: #f6f8fa;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
    font: inherit;
    cursor: pointer;
    background: #fff;
    color: #1f2328;
    border: 1px solid #d0d7de;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.15s, border-color 0.15s;
}
button:hover:not(:disabled) { background: #f6f8fa; border-color: #afb8c1; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
button.primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
button.danger {
    background: #fff;
    color: #cf222e;
    border-color: #d0d7de;
}
button.danger:hover:not(:disabled) { background: #ffebe9; border-color: #cf222e; }
button.small { padding: 3px 10px; font-size: 12px; }

input, select, textarea {
    font: inherit;
    padding: 6px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: #1f2328;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
label { display: block; font-size: 13px; color: #57606a; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field input, .field select, .field textarea { width: 100%; }

/* --- 布局 --- */
.layout { display: flex; height: 100vh; }
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e1e4e8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar .brand {
    padding: 20px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2328;
    border-bottom: 1px solid #e1e4e8;
}
.sidebar .brand small { display: block; color: #6e7781; font-weight: normal; margin-top: 3px; font-size: 11px; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
    display: block;
    padding: 8px 18px;
    color: #24292f;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #f6f8fa; text-decoration: none; }
.sidebar nav a.active {
    background: #ddf4ff;
    border-left-color: #2563eb;
    color: #0550ae;
    font-weight: 500;
}
.sidebar .foot {
    padding: 14px 18px;
    border-top: 1px solid #e1e4e8;
    font-size: 12px;
    color: #57606a;
}
.sidebar .foot .username { color: #1f2328; font-weight: 500; margin-bottom: 8px; }
.sidebar .foot .role-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: normal;
}
.role-tag.admin { background: #dbeafe; color: #1e40af; }
.role-tag.user { background: #f0f0f0; color: #57606a; }

.main {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}
.page-title { font-size: 20px; font-weight: 600; margin: 0 0 18px 0; }
.page-title .actions { float: right; }
.page-title .actions button { margin-left: 8px; }

/* --- 卡片 & 表格 --- */
.card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}
.card h3 { margin: 0 0 14px 0; font-size: 15px; }

table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}
table.data th, table.data td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #eaeef2;
}
table.data th {
    background: #f6f8fa;
    color: #57606a;
    font-weight: 500;
    position: sticky;
    top: 0;
}
table.data tr:hover td { background: #f6f8fa; }
table.data td code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #24292f;
}

.chain-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
}
.chain-erc20 { background: #e0e7ff; color: #3730a3; }
.chain-bsc { background: #fef3c7; color: #92400e; }
.chain-trc20 { background: #fecaca; color: #991b1b; }
.chain-btc { background: #fed7aa; color: #9a3412; }

.status { font-size: 12px; color: #57606a; }
.status .warn { color: #b45309; font-weight: 500; }
.status .err { color: #cf222e; font-weight: 500; }
.status .ok { color: #116329; }

/* --- 登录页 --- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
}
.login-box {
    background: #fff;
    padding: 36px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    width: 360px;
}
.login-box h1 { margin: 0 0 4px 0; font-size: 22px; }
.login-box .subtitle { color: #6e7781; margin-bottom: 24px; font-size: 13px; }
.login-box .err {
    background: #ffebe9;
    color: #cf222e;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}
.login-box button[type=submit] { width: 100%; padding: 9px; }

/* --- modal --- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal {
    background: #fff;
    border-radius: 8px;
    min-width: 420px;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px 24px;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal .foot {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 工具 */
.flex { display: flex; align-items: center; }
.flex.gap { gap: 10px; }
.flex.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: #6e7781; font-size: 12px; }
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2328;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    z-index: 2000;
}
.toast.err { background: #cf222e; }
.toast.ok { background: #1a7f37; }

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #eaeef2;
}
.switch-row:last-child { border-bottom: none; }
.switch-row label { margin: 0; color: #24292f; font-size: 13px; }
input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }
