/* 永乐抖音 - 鲜艳现代风格 */
:root {
    --coral: #FF6B6B;
    --coral-dark: #EE5A5A;
    --cyan: #00D9FF;
    --lime: #7BED7B;
    --gold: #FFD93D;
    --bg: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-card-hover: #252525;
    --text: #ffffff;
    --text-soft: #b0b0b0;
    --border: #333;
    --danger: #FF4757;
    --success: #2ED573;
    --radius: 10px;
    --font: "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========== 前台 ========== */
.front-page { display: flex; flex-direction: column; min-height: 100vh; }

.site-header {
    position: relative;
    padding: 3.5rem 2rem;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, #FF6B6B 0%, #FF8E53 40%, #FFD93D 100%);
}

.header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.header-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

.header-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-content p {
    margin-top: 0.6rem;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.9);
}

.site-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.form-control {
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255,107,107,0.25);
}

.btn {
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.45);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-soft);
}

.btn-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background: #ff2f43;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.35rem;
    border-left: 4px solid var(--coral);
    transition: all 0.25s;
}

.video-card:hover {
    background: var(--bg-card-hover);
    border-left-color: var(--cyan);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.video-card h3 {
    font-size: 1rem;
    color: var(--cyan);
    margin-bottom: 0.6rem;
    word-break: break-all;
}

.video-card .meta {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.video-card .content {
    font-size: 0.9rem;
    line-height: 1.65;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.video-card .topics {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--lime);
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* ========== 后台 ========== */
.admin-page { min-height: 100vh; }

.admin-header {
    background: linear-gradient(90deg, #1a1a1a 0%, #252525 100%);
    border-bottom: 3px solid var(--coral);
    padding: 1rem 2rem;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.admin-nav {
    display: flex;
    gap: 0;
}
.admin-nav a {
    padding: 0.6rem 1.2rem;
    color: var(--text-soft);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.admin-nav a:hover { color: var(--cyan); }
.admin-nav a.active {
    color: var(--coral);
    border-bottom-color: var(--coral);
}

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: linear-gradient(180deg, #252525 0%, #1f1f1f 100%);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cyan);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
    background: rgba(0,217,255,0.05);
}

.data-table td { font-size: 0.9rem; }

.data-table .cell-link {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table .cell-desc {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.55rem 1.1rem;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--coral);
    color: var(--coral);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* ========== 登录页 ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 50%, #0d0d0d 100%);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2.25rem;
    border: 2px solid var(--border);
    box-shadow: 0 0 0 1px rgba(255,107,107,0.1), 0 20px 50px rgba(0,0,0,0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--coral);
}

.login-header p {
    margin-top: 0.5rem;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.login-form .form-group { margin-bottom: 1.25rem; }

.login-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--coral);
}

.btn-block {
    width: 100%;
    padding: 0.9rem;
    margin-top: 0.5rem;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(255,71,87,0.2);
    border: 2px solid var(--danger);
    color: #ff6b7a;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-soft);
}

.empty-state p {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* ========== 远程操作页 ========== */
.remote-main { padding: 2rem; }

.section-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.section-title {
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #252525 0%, #1f1f1f 100%);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cyan);
    border-bottom: 1px solid var(--border);
}

.section-body { padding: 1.25rem; }

.status-row { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 1rem; }

.status-item { display: flex; align-items: center; gap: 0.5rem; }

.status-label { color: var(--text-soft); font-size: 0.9rem; }

.status-value { color: var(--lime); font-weight: 600; }

.status-value.idle { color: var(--text-soft); }

.status-value.processing { color: var(--gold); }

.progress-bar-wrap {
    height: 24px;
    background: #252525;
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--coral) 0%, var(--gold) 100%);
    transition: width 0.3s;
}

.task-list {
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 8px;
    padding: 0.75rem;
}

.task-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    list-style: none;
}

.task-list li:last-child { border-bottom: none; }

.task-list li.empty { color: var(--text-soft); }

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.form-row label { min-width: 100px; color: var(--text-soft); padding-top: 0.6rem; }

.form-row input, .form-row textarea {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

.form-row textarea { min-height: 80px; resize: vertical; }

.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-group .btn { padding: 0.65rem 1.25rem; }

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.config-item label { display: block; color: var(--text-soft); font-size: 0.85rem; margin-bottom: 0.35rem; }

.config-item input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.setup-tip {
    background: rgba(0,217,255,0.08);
    border-color: var(--cyan);
}

.setup-tip a {
    color: var(--cyan);
    text-decoration: underline;
}

.setup-tip a:hover {
    color: var(--lime);
}

.offline-tip {
    padding: 1rem;
    background: rgba(255,71,87,0.15);
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: #ff6b7a;
    font-size: 0.9rem;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(46,213,115,0.2);
    border: 1px solid var(--success);
    border-radius: 8px;
    color: var(--lime);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.online-badge .status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
