/* RoboDK 视频库 — 前端样式（参考 www.robodk.info 风格统一） */
:root {
    --brand: #FF6A00;        /* RoboDK 品牌橙 */
    --brand-dark: #e85d00;
    --ink: #1f2933;
    --muted: #6b7280;
    --bg: #f5f6f8;
    --card: #ffffff;
    --nav-bg: #ffffff;
    --footer-bg: #16213e;
    --border: #e5e7eb;
    --shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶部联系条 */
.topbar { background: var(--footer-bg); color: #cbd5e1; font-size: .8rem; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .4rem 1rem; display: flex; gap: 1.5rem; }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }

/* 主导航 */
.site-header { background: var(--nav-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header-inner { max-width: 1200px; margin: 0 auto; padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.logo-mark { color: var(--brand); }
.main-nav { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
.main-nav > li { position: relative; }
.main-nav > li > a { font-size: .95rem; color: var(--ink); padding: .4rem 0; display: inline-block; border-bottom: 2px solid transparent; }
.main-nav > li > a:hover, .main-nav > li.active > a { color: var(--brand); border-bottom-color: var(--brand); }
.caret { font-size: .7em; }
.has-dropdown .dropdown {
    position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: var(--shadow); min-width: 220px; list-style: none;
    padding: .4rem 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s;
}
.has-dropdown:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a { display: block; padding: .5rem 1rem; font-size: .9rem; color: var(--ink); }
.dropdown li a:hover { background: var(--bg); color: var(--brand); }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; flex: 1; width: 100%; }

/* hero */
.hero { text-align: center; padding: 2.5rem 1rem; background: linear-gradient(135deg, #16213e, #1a1a2e); color: #fff; border-radius: 12px; margin-bottom: 2rem; }
.hero h1 { font-size: 2rem; margin-bottom: .5rem; }
.hero p { color: #cbd5e1; }

/* 播放列表网格 */
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.playlist-card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.playlist-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(255, 106, 0, .18); }
.cover { width: 100%; aspect-ratio: 16/9; background: #16213e; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.playlist-card h3 { color: var(--brand); margin: .8rem 1rem .3rem; font-size: 1.05rem; }
.playlist-card .count { display: block; color: var(--muted); font-size: .85rem; padding: 0 1rem 1rem; }

/* 视频网格 */
.page-title { margin-bottom: 1.2rem; }
.page-title h1 { font-size: 1.5rem; }
.page-title p { color: var(--muted); font-size: .9rem; }
.back-link { display: inline-block; color: var(--brand); margin-bottom: 1rem; font-size: .9rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.video-card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; }
.video-card:hover { transform: translateY(-4px); }
.thumb { width: 100%; aspect-ratio: 16/9; background: #16213e; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .info { padding: .9rem 1rem; }
.video-card .info h3 { font-size: .95rem; line-height: 1.4; font-weight: 600; }

/* 播放器 */
.player-wrap { background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 1.2rem; }
.player-wrap video { width: 100%; max-height: 75vh; display: block; background: #000; }
.video-title { font-size: 1.4rem; margin-bottom: .4rem; }
.video-meta { color: var(--muted); font-size: .9rem; }

/* 分页 */
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 2rem 0; color: var(--muted); }
.pager a { color: var(--brand); padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 6px; }
.pager a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 关于 */
.about { max-width: 800px; }
.about h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.about h2 { font-size: 1.2rem; margin: 1.5rem 0 .6rem; }
.about p { line-height: 1.8; color: #374151; margin-bottom: .8rem; }
.about ul { padding-left: 1.2rem; line-height: 1.9; }

/* 页脚 */
.site-footer { background: var(--footer-bg); color: #cbd5e1; margin-top: 2rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.footer-col h4 { color: #fff; margin-bottom: .8rem; font-size: 1rem; }
.footer-col p { font-size: .88rem; line-height: 1.7; }
.footer-col a { color: var(--brand); }
.footer-bottom { text-align: center; padding: 1rem; font-size: .8rem; color: #94a3b8; border-top: 1px solid rgba(255, 255, 255, .08); }

@media (max-width: 640px) {
    .main-nav { gap: 1rem; }
    .hero h1 { font-size: 1.5rem; }
}

/* ===== 后台管理（admin.php） ===== */
.admin-body { background: var(--bg); }

/* 登录页 */
.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; background: linear-gradient(135deg, #16213e, #1a1a2e);
}
.login-card {
    width: 100%; max-width: 380px; background: var(--card); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25); padding: 2.2rem 2rem;
}
.login-brand { text-align: center; margin-bottom: 1.6rem; }
.login-logo { font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.login-mark { color: var(--brand); }
.login-brand p { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.login-form { margin-top: .5rem; }
.field { display: block; margin-bottom: 1.2rem; }
.field > span { display: block; font-size: .85rem; color: var(--ink); margin-bottom: .45rem; font-weight: 600; }
.login-hint { color: var(--muted); font-size: .8rem; line-height: 1.6; margin-top: 1.2rem; text-align: center; }

/* 输入框通用 */
.field input, .seo-form input[type=text], .seo-form input:not([type]),
.seo-form textarea, .login-form input {
    width: 100%; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 8px;
    font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .seo-form input:focus, .seo-form textarea:focus, .login-form input:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 106, 0, .15);
}
.seo-form textarea { width: 100%; resize: vertical; line-height: 1.6; }
.pwd-wrap { position: relative; }
.pwd-toggle {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: .8rem;
    color: var(--muted); padding: .2rem .4rem; border-radius: 6px;
}
.pwd-toggle:hover { color: var(--brand); background: var(--bg); }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.2rem; border: 1px solid transparent; border-radius: 8px;
    font-size: .92rem; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; padding: .78rem; font-size: 1rem; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* 管理面板布局 */
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.admin-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.admin-head h1 { font-size: 1.4rem; }
.admin-head .sub { color: var(--muted); font-size: .85rem; font-weight: 400; margin-left: .6rem; }

/* 提示条 */
.notice { padding: .8rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; border: 1px solid transparent; }
.notice-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.notice-err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* 卡片区块 */
.admin-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; box-shadow: var(--shadow);
}
.admin-card h2 {
    font-size: 1.05rem; margin-bottom: 1rem; padding-bottom: .55rem;
    border-bottom: 1px solid var(--border); color: var(--ink);
}
.admin-card > label { display: block; margin-bottom: .9rem; font-size: .88rem; color: var(--ink); }
.admin-check { display: flex; align-items: center; gap: .5rem; }
.admin-check input { width: auto; margin: 0; }
.admin-hint { color: var(--muted); font-size: .82rem; line-height: 1.6; margin-top: .4rem; }
.ping-result {
    margin-top: 1rem; padding: .9rem 1rem; background: #0f172a; color: #cbd5e1;
    border-radius: 8px; font-size: .82rem; line-height: 1.6; white-space: pre-wrap; overflow-x: auto;
}

/* Toast 浮层提示 */
.toast-container {
    position: fixed; top: 1.2rem; right: 1.2rem; z-index: 9999;
    display: flex; flex-direction: column; gap: .6rem;
}
.toast {
    min-width: 240px; max-width: 360px; padding: .85rem 1.1rem; border-radius: 10px;
    color: #fff; font-size: .9rem; line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    animation: toast-in .25s ease; transition: opacity .3s, transform .3s;
}
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
