/**
 * 全站样式：毛玻璃、响应式、骨架与 Toast。
 */

:root {
    --bg-deep: #070a12;
    --accent: #6ee7ff;
    --accent-2: #a78bfa;
    --text: #e8edf7;
    --text-muted: #94a3b8;
    --danger: #fb7185;
    --success: #4ade80;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.14);
    --radius: 16px;
    --shadow-glow: 0 0 32px rgba(110, 231, 255, 0.12);
    --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
    --header-h: 72px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-deep);
}

body {
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
    color: inherit;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(ellipse 120% 80% at 20% -10%, rgba(110, 231, 255, 0.18), transparent 55%),
        radial-gradient(ellipse 100% 60% at 100% 20%, rgba(167, 139, 250, 0.2), transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(56, 189, 248, 0.12), transparent 45%), var(--bg-deep);
}

.page-bg::after {
    content: "";
    position: absolute;
    width: 140%;
    height: 140%;
    left: -20%;
    top: -20%;
    background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%);
    animation: aurora 18s ease-in-out infinite;
}

@keyframes aurora {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-4%, 3%) rotate(2deg);
    }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 16px;
    backdrop-filter: blur(14px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 12px 18px;
    border-radius: var(--radius);
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-glow);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 1.05rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s, transform 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.nav-link--active {
    color: var(--text);
    background: rgba(110, 231, 255, 0.12);
    box-shadow: 0 0 20px rgba(110, 231, 255, 0.15);
}

.header-search {
    display: flex;
    flex: 1 1 220px;
    min-width: 0;
    gap: 8px;
    align-items: center;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        margin-left: 0;
    }

    .header-search {
        flex-basis: 100%;
    }
}

.glass-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-input:focus {
    border-color: rgba(110, 231, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.25), rgba(167, 139, 250, 0.25));
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    box-shadow: 0 4px 24px rgba(110, 231, 255, 0.15);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(110, 231, 255, 0.28);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

.btn--ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn--danger {
    border-color: rgba(251, 113, 133, 0.4);
    color: #fecdd3;
}

.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.page-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
}

.page-desc {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.object-card {
    padding: 18px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.object-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(110, 231, 255, 0.2);
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.badge--active {
    border-color: rgba(74, 222, 128, 0.35);
    color: var(--success);
}

.badge--inactive {
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    min-height: 1em;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-card {
    height: 180px;
    border-radius: var(--radius);
}

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    border-radius: var(--radius);
}

.empty-state strong {
    display: block;
    color: var(--text);
    margin-bottom: 8px;
}

.error-banner {
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(251, 113, 133, 0.35);
    background: rgba(251, 113, 133, 0.08);
    color: #fecdd3;
    margin-bottom: 20px;
}

.detail-grid {
    display: grid;
    gap: 18px;
}

@media (min-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.detail-section {
    padding: 20px;
    border-radius: var(--radius);
}

.detail-section h2 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 0.92rem;
}

.kv dt {
    margin: 0;
    color: var(--text-muted);
}

.kv dd {
    margin: 0;
    word-break: break-all;
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 560px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.field-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tx-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: auto;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    border-color: rgba(74, 222, 128, 0.35);
}

.toast--error {
    border-color: rgba(251, 113, 133, 0.45);
    color: #fecdd3;
}

.toast--info {
    border-color: rgba(110, 231, 255, 0.35);
}

.pay-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.warning-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-size: 0.88rem;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.mono {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
}

.hidden {
    display: none !important;
}
