/* 基础重置 & 主题色 */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif;
    background-color: #0f172a; /* 深色背景 */
    color: #e5e7eb;
    line-height: 1.5;
}

/* 隐藏辅助类 */

.hidden {
    display: none !important;
}

/* 链接 */

a {
    color: #38bdf8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 通用按钮 */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background-color: #1f2937;
    color: #e5e7eb;
    gap: 4px;
}

.btn:hover {
    background-color: #374151;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #4b5563;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background-color: #6b7280;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* 标题 */

h1,
h2,
h3 {
    font-weight: 600;
    color: #e5e7eb;
}

/* Toast 全局提示 */

.toast {
    position: fixed;
    top: 12px;
    right: 16px;
    min-width: 180px;
    max-width: 320px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    background-color: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    border: 1px solid #3b82f6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Modal 通用样式（配合 layout.css） */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal {
    width: 360px;
    max-width: 90vw;
    background-color: #0b1220;
    border-radius: 12px;
    padding: 18px 18px 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid #1d283a;
}

.modal h2 {
    font-size: 16px;
    margin-bottom: 12px;
}

.modal-item-detail {
    width: 520px;
    max-width: 95vw;
}

.item-detail-field {
    display: flex;
    margin: 4px 0;
    font-size: 11px;
    color: #e5e7eb;
    gap: 4px;
}

.item-detail-field .label {
    flex-shrink: 0;
    color: #9ca3af;
    min-width: 70px;
    text-align: right;
}

.detail-description pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: inherit;
    font-size: 11px;
    color: #9ca3af;
}

/* 全局 Loading 遮罩 */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-box {
    background-color: #020817;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #111827;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #1f2937;
    border-top-color: #3b82f6;
    animation: spin 0.6s linear infinite;
}

.loading-text {
    font-size: 12px;
    color: #e5e7eb;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
