/* SMap - 图片上传与分享管理系统 */
:root {
    --bg: #0f0f12;
    --surface: #18181c;
    --border: #2a2a30;
    --text: #e4e4e7;
    --muted: #71717a;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --error: #f87171;
    --success: #34d399;
    --radius: 10px;
    --font: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.site-header a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-header a:hover {
    color: var(--text);
}

.user {
    color: var(--muted);
    font-size: 0.9rem;
}

/* 认证页 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.auth-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-card .error {
    margin-bottom: 1rem;
    padding: 0.6rem;
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-radius: 6px;
    font-size: 0.9rem;
}

.auth-card label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-card input {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-card button {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-card button:hover {
    background: var(--accent-hover);
}

.auth-link {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* 仪表盘 */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.upload-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, background 0.2s;
}

.upload-section.dragover {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.06);
}

.upload-section.dragover .drop-area {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.1);
}

.upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.upload-form .drop-area {
    flex: 1;
    min-width: 260px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.5rem;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-form .drop-area:hover {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.06);
}

.upload-form input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.upload-form .drop-text {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
}

.upload-form .drop-sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.upload-form .file-count {
    margin-top: 0.25rem;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-form button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-form button {
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-form button:hover {
    background: var(--accent-hover);
}

.hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.status.success { color: var(--success); }
.status.error { color: var(--error); }

/* 图片网格 */
.images-section .empty {
    color: var(--muted);
    font-size: 0.95rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.image-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.image-card:hover {
    border-color: var(--accent);
}

.image-card .thumb {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg);
}

.image-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-card .meta {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.image-card .name {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card .date {
    font-size: 0.8rem;
    color: var(--muted);
}

.image-card .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.image-card .actions button {
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.image-card .actions button:hover {
    background: var(--border);
    border-color: var(--muted);
}

.image-card .actions .btn-copy,
.image-card .actions .btn-share,
.image-card .actions .btn-embed {
    color: var(--accent);
    border-color: var(--accent);
}

.image-card .actions .btn-copy:hover,
.image-card .actions .btn-share:hover,
.image-card .actions .btn-embed:hover {
    background: rgba(167, 139, 250, 0.15);
}

.image-card .actions .btn-delete:hover {
    border-color: var(--error);
    color: var(--error);
}

/* 管理后台 */
.admin-dashboard .admin-section {
    margin-bottom: 2rem;
}

.admin-dashboard .admin-section h2 {
    margin-bottom: 0.5rem;
}

.admin-meta {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--muted);
    font-weight: 500;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-table .btn-link {
    color: var(--accent);
    text-decoration: none;
    margin-right: 0.5rem;
}

.admin-table .btn-link:hover {
    text-decoration: underline;
}

.admin-table .btn-danger {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 4px;
    cursor: pointer;
}

.admin-table .btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
}
