/* ========================================
   全局样式 — 白色卡片 + 淡灰背景 + 蓝紫渐变按钮
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #5b6abf;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---- 容器 ---- */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ---- 卡片 ---- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.subtitle {
    color: #888;
    font-size: 14px;
}

.card-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ---- 表单 ---- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.form-hint {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
    background: #fafafa;
}

.form-input:focus {
    border-color: #5b6abf;
    background: #fff;
}

.form-file {
    padding: 10px;
    background: #fff;
}

.radio-group {
    display: flex;
    gap: 24px;
    padding: 8px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #555;
}

.btn-outline:hover {
    border-color: #5b6abf;
    color: #5b6abf;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 5px;
}

/* ---- 提示 ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.alert-success {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

/* ---- 链接 ---- */
.link-muted {
    color: #999;
    font-size: 13px;
}

.link-muted:hover {
    color: #5b6abf;
}

/* ---- 文件页 ---- */
.file-card {
    text-align: center;
    max-width: 480px;
}

.file-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.file-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.file-detail:last-child {
    border-bottom: none;
}

.file-detail .label {
    color: #888;
    font-size: 14px;
}

.file-detail .value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

/* ---- 图片页 ---- */
.image-card {
    max-width: 800px;
    text-align: center;
}

.image-preview {
    margin: 20px 0;
}

.image-preview img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* ---- 404 页 ---- */
.error-card {
    text-align: center;
    max-width: 400px;
}

.error-code {
    font-size: 80px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

/* ========================================
   后台样式
   ======================================== */

.admin-body {
    background: #f0f2f5;
}

.admin-nav {
    background: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.nav-back {
    font-size: 15px;
    font-weight: 500;
    color: #5b6abf;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    font-size: 14px;
    color: #666;
}

.admin-container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

/* ---- 工具栏 ---- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---- 表格 ---- */
.table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    border-bottom: 2px solid #eee;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #fafbff;
}

.row-disabled {
    opacity: 0.5;
}

.td-ellipsis {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.td-empty {
    text-align: center;
    color: #999;
    padding: 40px 16px !important;
}

/* ---- 密码文本 ---- */
.password-text {
    background: #f0f2f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", monospace;
    letter-spacing: 1px;
    user-select: all;
}

.password-display {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 16px;
    letter-spacing: 2px;
    user-select: all;
}

/* ---- 徽章 ---- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue {
    background: #e8f0fe;
    color: #1a73e8;
}

.badge-green {
    background: #e6f7e9;
    color: #28a745;
}

.badge-gray {
    background: #f0f0f0;
    color: #888;
}

/* ---- 编辑卡片 ---- */
.edit-card {
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   响应式
   ======================================== */

@media (max-width: 768px) {
    .card {
        padding: 28px 20px;
        margin: 10px;
    }

    .admin-container {
        padding: 0 12px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .btn {
        width: 100%;
        text-align: center;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .td-actions {
        flex-direction: column;
        gap: 4px;
    }

    .td-actions .btn-xs {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   拖拽上传区域
   ======================================== */

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
    position: relative;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #f5f3ff;
}

.drop-zone-over {
    border-color: #667eea;
    background: #ede9fe;
}

.drop-zone-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.drop-zone-prompt p {
    margin: 8px 0 0;
    color: #666;
    font-size: 15px;
}

.drop-zone-hint {
    font-size: 13px !important;
    color: #999 !important;
}

.drop-zone-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
}

.drop-zone-file-icon {
    font-size: 24px;
}

.drop-zone-file-name {
    color: #333;
    font-weight: 500;
    word-break: break-all;
}

.drop-zone-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drop-zone-remove:hover {
    background: #c0392b;
}
