/* ============================================================
   照片收集系统 - 全局样式
   风格：现代蓝色直角设计（无圆角），移动端优先
   ============================================================ */

:root {
    --primary: #1a73e8;      /* 主色：现代蓝 */
    --primary-dark: #1557b0;
    --primary-light: #e8f1fe;
    --success: #0f9d58;
    --danger: #d93025;
    --warning: #f9ab00;
    --text: #202124;
    --text-2: #5f6368;
    --border: #dadce0;
    --bg: #f5f6f8;
    --card: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.page-header {
    text-align: center;
    padding: 32px 0 24px;
}

.page-header .logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------- 表单 ---------- */
label.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    font-size: 15px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    border-radius: 0;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .18);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 18px;
    text-align: center;
    transition: background .15s, opacity .15s;
    border-radius: 0;
    -webkit-appearance: none;
}

.btn-block { display: block; width: 100%; margin-bottom: 10px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0b8043; text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b31412; text-decoration: none; }
.btn-ghost { background: #f1f3f4; color: var(--text); }
.btn-ghost:hover { background: #e2e5e7; text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 链接结果框 ---------- */
.link-result {
    display: none;
    background: #e6f4ea;
    border: 1px solid #ceead6;
    padding: 16px;
    margin-bottom: 16px;
}

.link-result .link-box {
    background: #fff;
    border: 1px solid #ceead6;
    padding: 10px 12px;
    font-size: 13px;
    word-break: break-all;
    color: var(--text-2);
    margin: 10px 0;
    user-select: all;
}

/* ---------- 提示条 ---------- */
.alert {
    padding: 11px 14px;
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid;
}
.alert-info    { background: var(--primary-light); border-color: #bcd7f7; color: var(--primary-dark); }
.alert-success { background: #e6f4ea; border-color: #ceead6; color: #0b8043; }
.alert-danger  { background: #fce8e6; border-color: #f5c6c2; color: #b31412; }
.alert-warning { background: #fef7e0; border-color: #feefc3; color: #a86800; }

/* ---------- 上传区 ---------- */
.upload-zone {
    border: 2px dashed var(--border);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone .icon { font-size: 42px; color: #bdc1c6; }
.upload-zone p { color: var(--text-2); font-size: 14px; margin-top: 8px; }

#previewArea {
    display: none;
    text-align: center;
    margin-bottom: 14px;
}

#previewArea img {
    max-width: 100%;
    max-height: 320px;
    border: 1px solid var(--border);
}

/* ---------- 照片墙 ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.photo-item {
    position: relative;
    background: #eef0f2;
    border: 1px solid var(--border);
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform .2s;
}

.photo-item img:hover { transform: scale(1.03); }

.photo-item .time {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-item .del-btn {
    position: absolute;
    top: 6px; right: 6px;
    background: var(--danger);
    color: #fff;
    border: none;
    width: 26px; height: 26px;
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
    display: none;
}

.photo-item:hover .del-btn { display: block; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    white-space: nowrap;
}
.tbl th, .tbl td {
    border: 1px solid var(--border);
    padding: 9px 10px;
    text-align: left;
}
.tbl th { background: #f1f3f4; font-weight: 600; }
.tbl tr:hover td { background: #f8f9fa; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
}
.badge-ok  { background: #e6f4ea; color: #0b8043; }
.badge-off { background: #f1f3f4; color: var(--text-2); }

/* ---------- 统计卡片（仪表盘） ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px;
    border-top: 4px solid var(--primary);
}

.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ---------- 最近上传 ---------- */
.recent-list { list-style: none; }
.recent-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list img {
    width: 52px; height: 52px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.recent-list .info { flex: 1; min-width: 0; }
.recent-list .info b { display: block; font-size: 14px; }
.recent-list .info span { font-size: 12px; color: var(--text-2); }

/* ---------- 顶部导航（后台） ---------- */
.admin-top {
    background: #202124;
    color: #fff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.admin-top .brand { font-weight: 700; font-size: 16px; color: #fff; }
.admin-top .brand:hover { text-decoration: none; }

.admin-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
}

.admin-nav a {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-2);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.admin-nav a:hover { text-decoration: none; color: var(--primary); }
.admin-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 大图查看 ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
}

.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; }
.lightbox .close {
    position: absolute;
    top: 12px; right: 16px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}
.lightbox .cap { color: #ddd; font-size: 13px; margin-top: 10px; }

/* ---------- 空状态 ---------- */
.empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-2);
}
.empty .icon { font-size: 52px; color: #d5d8db; }
.empty p { margin-top: 10px; font-size: 14px; }

/* ---------- 安装向导 ---------- */
.install-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.install-steps .step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
}
.install-steps .step .dot {
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}
.install-steps .step.active { color: var(--primary); font-weight: 600; }
.install-steps .step.active .dot { border-color: var(--primary); color: var(--primary); }
.install-steps .step.done { color: var(--success); }
.install-steps .step.done .dot { border-color: var(--success); color: var(--success); }

.check-list { list-style: none; }
.check-list li {
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.check-list li:last-child { border-bottom: none; }
.check-list .ok { color: var(--success); font-weight: 600; }
.check-list .bad { color: var(--danger); font-weight: 600; }

/* ---------- 页脚 ---------- */
.footer {
    text-align: center;
    color: #9aa0a6;
    font-size: 12px;
    padding: 20px 0 10px;
}

/* ---------- 移动端优化 ---------- */
@media (max-width: 480px) {
    .container { padding: 12px 12px 50px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .photo-item img { height: 110px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .page-header { padding: 20px 0 16px; }
}
