/* 拍摄链接控制台 —— 无登录单用户版 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0e1014;
    --bg2: #14171d;
    --card: #181c24;
    --card2: #1f242e;
    --line: #262c38;
    --txt: #e8ecf3;
    --txt2: #98a3b3;
    --accent: #4f8cff;
    --accent2: #7c5cff;
    --ok: #2ecc71;
    --warn: #f5a623;
    --danger: #ff5c6c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, #1b2130 0%, var(--bg) 55%) fixed;
    color: var(--txt);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }

/* 顶栏 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(14, 16, 20, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand span { color: var(--accent); }
.stats { font-size: 13px; color: var(--txt2); }
.stats b { color: var(--txt); font-weight: 600; }

/* 数据库异常红条 */
.dbwarn {
    max-width: 1080px;
    margin: 16px auto 0;
    padding: 13px 16px;
    border-radius: 12px;
    background: rgba(255, 92, 108, .12);
    border: 1px solid rgba(255, 92, 108, .45);
    color: #ffc9d0;
    font-size: 13px;
    line-height: 1.8;
}
.dbwarn strong { color: #ff8a99; }
.dbwarn code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }
.dbwarn a { color: #ffd6dc; text-decoration: underline; }

main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 16px 60px;
    display: grid;
    gap: 18px;
}

/* 卡片 */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.card h2 { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--txt2); margin-top: 6px; line-height: 1.6; }

/* 模式选择 */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mode { position: relative; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--bg2);
    font-size: 14px;
    transition: .18s;
    text-align: center;
}
.mode span i { font-style: normal; font-size: 22px; }
.mode input:checked + span {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(79,140,255,.16), rgba(79,140,255,.05));
    box-shadow: 0 0 0 3px rgba(79,140,255,.12), inset 0 0 24px rgba(79,140,255,.08);
}
.mode span small { color: var(--txt2); font-size: 11px; }

/* 表单行 */
.row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.row > label { min-width: 84px; font-size: 13px; color: var(--txt2); }
.row > label b { color: var(--accent); font-weight: 700; }

select, input[type="text"] {
    background: var(--bg2);
    color: var(--txt);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    min-width: 150px;
    font-family: inherit;
}
select:focus, input[type="text"]:focus { border-color: var(--accent); }

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 180px;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 3px solid var(--accent); cursor: pointer;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--txt);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    transition: .15s;
}
button:hover { border-color: #3a4356; background: #262c38; }
button:active { transform: translateY(1px); }
button.primary {
    width: 100%;
    margin-top: 18px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    box-shadow: 0 8px 22px rgba(79,140,255,.28);
}
button.primary:disabled { opacity: .6; cursor: wait; }
button.mini { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
button.danger { color: var(--danger); }
button.warn { color: var(--warn); }

/* 列表 */
.list { margin-top: 12px; display: grid; gap: 10px; }
.item {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 13px 14px;
    background: var(--bg2);
    display: grid;
    gap: 9px;
}
.item.new { animation: pop .5s ease; border-color: var(--accent); }
@keyframes pop { from { transform: scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
.item-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: .4px;
    border: 1px solid transparent;
}
.badge.photo { color: #6ec1ff; background: rgba(110,193,255,.12); border-color: rgba(110,193,255,.3); }
.badge.video { color: #ff9f6e; background: rgba(255,159,110,.12); border-color: rgba(255,159,110,.3); }
.badge.audio { color: #9be36e; background: rgba(155,227,110,.12); border-color: rgba(155,227,110,.3); }
.badge.off { color: var(--txt2); background: rgba(255,255,255,.06); border-color: var(--line); }

.item .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: 1.2px; }
.item .meta { font-size: 12px; color: var(--txt2); line-height: 1.7; }
.item .url {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #8fb6ff;
    background: rgba(79,140,255,.07);
    border: 1px dashed rgba(79,140,255,.25);
    padding: 8px 10px;
    border-radius: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ops { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; color: var(--txt2); font-size: 13px; padding: 26px 10px; }

/* 查看抽屉 */
.viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(6, 8, 12, .72);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: flex-end;
}
.viewer[hidden] { display: none; }
.viewer-panel {
    width: min(760px, 100%);
    height: 100%;
    background: var(--bg);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    animation: slide .22s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 2;
}
.viewer-head h3 { font-size: 15px; font-weight: 600; }
.viewer-head .sub { font-size: 12px; color: var(--txt2); margin-top: 3px; }
.viewer-body { padding: 16px; overflow-y: auto; display: grid; gap: 14px; }

.media {
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    background: var(--bg2);
}
.media img, .media video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.media audio { display: block; width: 100%; padding: 14px; background: var(--bg2); }
.media audio::-webkit-media-controls-panel { background: var(--bg2); }
.media-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--txt2);
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.media-foot .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.media-foot .acts { display: flex; gap: 8px; }

/* toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(24, 28, 36, .96);
    border: 1px solid var(--line);
    color: var(--txt);
    padding: 11px 18px;
    border-radius: 30px;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: .22s;
    z-index: 200;
    max-width: 90vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(46,204,113,.5); }
.toast.err { border-color: rgba(255,92,108,.55); }

@media (max-width: 560px) {
    .modes { grid-template-columns: 1fr; }
    .row > label { min-width: 100%; }
    select, input[type="text"] { width: 100%; }
    .item .url { white-space: normal; word-break: break-all; }
}
