/* === 任务助手 - 全局样式 === */

:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --bg: #f8f9ff;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-muted: #636e72;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(108, 92, 231, 0.08);
    --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.15);
}

* { box-sizing: border-box; }

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

/* === 导航栏 === */
.navbar-bili {
    background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #c084fc 100%);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-bili .navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff !important;
    letter-spacing: 0.5px;
}

.navbar-bili .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
}

.navbar-bili .btn-outline-light {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.navbar-bili .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

/* === 欢迎区域 === */
.welcome-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.welcome-greeting {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.welcome-greeting .wave {
    display: inline-block;
    animation: wave 1.5s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-10deg); }
}

.expire-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.expire-badge.safe {
    background: #e6f9f1;
    color: #00b894;
}

.expire-badge.warning {
    background: #fff8e6;
    color: #e17055;
    animation: pulse 2s infinite;
}

.expire-badge.danger {
    background: #ffe8e3;
    color: #d63031;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === 状态概览卡片 === */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* === 空状态引导 === */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state .empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.empty-state .btn-add-first {
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    transition: all 0.3s;
}

.empty-state .btn-add-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
    color: #fff;
}

.empty-state .steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.empty-state .step {
    text-align: center;
    max-width: 120px;
}

.empty-state .step .step-num {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 auto 0.5rem;
}

.empty-state .step .step-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === 账号卡片网格 === */
.account-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .account-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === 单个账号卡片 === */
.account-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.account-card:hover {
    box-shadow: var(--shadow-hover);
}

.account-card.enabled {
    border-left: 4px solid var(--success);
}

.account-card.disabled {
    border-left: 4px solid #dfe6e9;
    opacity: 0.7;
}

.account-card .card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f0ff;
}

.account-card .card-header .account-name {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-card .card-header .account-name .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fd79a8, #e17055);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.account-card .card-header .level-badge {
    background: linear-gradient(135deg, #6c5ce7, #a855f7);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.account-card .card-body {
    padding: 0.75rem 1.25rem;
}

.account-card .info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.account-card .info-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-weight: 500;
}

.info-tag.active { background: #e6f9f1; color: #00b894; }
.info-tag.inactive { background: #f1f2f6; color: #b2bec3; }
.info-tag.auto-on { background: #e8e4ff; color: #6c5ce7; }
.info-tag.auto-off { background: #f1f2f6; color: #b2bec3; }
.info-tag.today-done { background: #e6f9f1; color: #00b894; }
.info-tag.today-pending { background: #fff8e6; color: #e17055; }

.account-card .last-run {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.account-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.account-card .card-actions .btn {
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    transition: all 0.2s;
}

.btn-run {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
    border: none;
}

.btn-run:hover { box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4); color: #fff; }
.btn-run:disabled { background: #dfe6e9; color: #b2bec3; box-shadow: none; }

.btn-logs-toggle {
    background: #f1f0ff;
    color: #6c5ce7;
    border: none;
}

.btn-logs-toggle:hover { background: #e4e2ff; }
.btn-logs-toggle.active { background: #6c5ce7; color: #fff; }

.btn-delete {
    background: #fff;
    color: #b2bec3;
    border: 1px solid #dfe6e9;
}

.btn-delete:hover { background: #ffe8e3; color: #e17055; border-color: #e17055; }

/* === 内联日志（默认显示） === */
.inline-logs {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f0ff;
}

.inline-log-entry {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.78rem;
    border-bottom: 1px dotted #f1f0ff;
}

.inline-log-entry:last-child { border-bottom: none; }

.inline-log-time {
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 68px;
    font-size: 0.75rem;
}

.inline-log-type {
    background: #e8e4ff;
    color: #6c5ce7;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.inline-log-msg {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

/* === 日志展开区域 === */
.logs-panel {
    display: none;
    background: #fafbff;
    border-top: 1px solid #f1f0ff;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.logs-panel.show {
    display: block;
}

.logs-panel .log-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f0ff;
}

.logs-panel .log-entry:last-child { border-bottom: none; }

.logs-panel .log-time {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: 65px;
}

.logs-panel .log-type {
    background: #e8e4ff;
    color: #6c5ce7;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.logs-panel .log-msg { flex: 1; }

.logs-panel .log-status {
    font-size: 1rem;
    min-width: 24px;
    text-align: center;
}

.logs-panel .log-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

.logs-panel .log-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === 添加账号按钮卡片 === */
.add-account-card {
    background: #fff;
    border: 2px dashed #dfe6e9;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.add-account-card:hover {
    border-color: var(--primary);
    background: #f8f9ff;
    box-shadow: var(--shadow);
}

.add-account-card .add-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.add-account-card .add-text {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

.add-account-card.disabled-card {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #dfe6e9;
}

.add-account-card.disabled-card .add-text {
    color: var(--text-muted);
}

/* === 模态框优化 === */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #f1f0ff;
    padding: 1.25rem 1.5rem;
}

.modal-body { padding: 1.5rem; }

/* === 开关组件美化 === */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.4em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* === Toast 提示 === */
.toast-mini {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

.toast-mini.success { background: #00b894; }
.toast-mini.error { background: #e17055; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === 登录/注册页 === */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1545 30%, #24243e 60%, #1a1545 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* 背景浮动装饰 */
.auth-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: authFloat 20s ease-in-out infinite;
}

.auth-shape-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.auth-shape-2 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    bottom: -80px;
    left: -80px;
    animation-delay: -7s;
}

.auth-shape-3 {
    width: 200px;
    height: 200px;
    background: #ec4899;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* 卡片容器 */
.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 440px;
    animation: cardSlideUp 0.6s ease-out;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 头部 */
.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo svg {
    width: 48px;
    height: 48px;
    display: block;
}

.auth-header h2 {
    font-weight: 800;
    font-size: 1.5rem;
    color: #1e1b4b;
    margin-bottom: 0.35rem;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

/* 步骤指示器 */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 14px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.auth-step span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.auth-step small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.auth-step.done span {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-step.done small {
    color: #6366f1;
}

.auth-step-line {
    width: 28px;
    height: 2px;
    background: #e2e8f0;
    margin-bottom: 16px;
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
}

.auth-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 0.3rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.15rem;
    color: #94a3b8;
    z-index: 2;
    pointer-events: none;
    transition: color 0.3s;
}

.auth-input {
    width: 100%;
    padding: 0.72rem 1rem 0.72rem 2.5rem;
    border: 2px solid #f1f5f9;
    border-radius: 14px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.auth-input::placeholder {
    color: #cbd5e1;
}

.auth-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: #6366f1;
}

/* 提交按钮 */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    margin-top: 0.25rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
    font-family: inherit;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(99, 102, 241, 0.45);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.auth-submit-btn i {
    transition: transform 0.3s;
}

.auth-submit-btn:hover i {
    transform: translateX(3px);
}

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.auth-footer a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #4f46e5;
}

.auth-footer a i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.auth-footer a:hover i {
    transform: translateX(2px);
}

/* 响应式 */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 20px;
    }

    .auth-header h2 {
        font-size: 1.3rem;
    }

    .auth-steps {
        padding: 0.6rem 0.5rem;
        gap: 0;
    }

    .auth-input {
        font-size: 0.9rem;
    }
}

/* === 左侧菜单 + 右侧内容布局 === */
.dashboard-layout {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    position: relative;
}

.sidebar-item:hover {
    background: #f5f7fb;
}

.sidebar-item.active {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.sidebar-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-item.active .sidebar-icon {
    background: #dbeafe;
}

.sidebar-title {
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 600;
}

.sidebar-item.active .sidebar-title {
    color: #6c5ce7;
}

.sidebar-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1px;
}

.sidebar-badge {
    margin-left: auto;
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.content-panel {
    display: none;
}

.content-panel.active {
    display: block;
}

/* === 响应式微调 === */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        gap: 8px;
        padding: 6px;
        position: static;
        overflow-x: auto;
    }

    .sidebar-item {
        flex-direction: column;
        gap: 4px;
        padding: 10px 16px;
        text-align: center;
        white-space: nowrap;
    }

    .sidebar-icon {
        font-size: 1.2rem;
        width: 32px;
        height: 32px;
    }

    .sidebar-sub { display: none; }
    .sidebar-badge { margin-left: 0; }
}

@media (max-width: 576px) {
    .welcome-section {
        flex-direction: column;
        text-align: center;
    }

    .account-card .card-actions .btn {
        flex: 1;
        text-align: center;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }

    .navbar-bili .navbar-brand {
        font-size: 1.1rem;
    }
}

/* === 经验显示 === */
.exp-row {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9ff;
    border-radius: 10px;
    flex-wrap: wrap;
}

.exp-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exp-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3436;
}

/* === 滚动条 === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dfe6e9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b2bec3; }

/* === 歌单浏览卡片 === */
.playlist-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e8f5e9;
}

.playlist-card-header {
    background: linear-gradient(135deg, #1db954 0%, #169c46 100%);
    padding: 1rem 1.25rem;
}

.playlist-header-icon {
    font-size: 1.5rem;
}

.playlist-header-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.playlist-header-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
}

.playlist-card-body {
    padding: 1.25rem;
}

.playlist-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.playlist-select {
    max-width: 180px;
    border-radius: 10px !important;
    border-color: #e0e0e0;
    font-size: 0.875rem;
}

.playlist-id-input {
    display: flex;
    flex: 1;
    gap: 0.5rem;
    min-width: 280px;
}

.playlist-id-input .form-control {
    border-radius: 10px;
    border-color: #e0e0e0;
    font-size: 0.875rem;
    flex: 1;
}

.playlist-id-input .form-control:focus {
    border-color: #1db954;
    box-shadow: 0 0 0 0.2rem rgba(29,185,84,0.15);
}

.playlist-fetch-btn {
    background: #1db954;
    color: #fff;
    border-radius: 10px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    border: none;
    transition: all 0.2s;
}

.playlist-fetch-btn:hover {
    background: #169c46;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29,185,84,0.3);
}

.playlist-fetch-btn:active {
    transform: translateY(0);
}

.playlist-result {
    margin-top: 1rem;
}

.playlist-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #f0faf3;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #2d3436;
}

.playlist-count-badge {
    background: #1db954;
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.playlist-song-list {
    max-height: 420px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid #eef2f7;
}

.playlist-song-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.15s;
    cursor: default;
}

.playlist-song-item:last-child {
    border-bottom: none;
}

.playlist-song-item:hover {
    background: #f8fdf9;
    border-left-color: #1db954;
}

.song-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f0faf3;
    color: #1db954;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.playlist-song-item:nth-child(-n+3) .song-index {
    background: linear-gradient(135deg, #1db954, #169c46);
    color: #fff;
}

.song-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.song-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3436;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-singer {
    font-size: 0.78rem;
    color: #94a3b8;
}

.playlist-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.playlist-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.85rem;
}

.playlist-empty {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.playlist-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.playlist-start-btn {
    background: #1db954;
    color: #fff;
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s;
}

.playlist-start-btn:hover {
    background: #169c46;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29,185,84,0.3);
}

.playlist-start-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.playlist-stop-btn {
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.playlist-stop-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.playlist-stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.playlist-active-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: #f0faf3;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #166534;
}

.playlist-active-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1db954;
    flex-shrink: 0;
    animation: playlist-pulse 1.5s ease-in-out infinite;
}

@@keyframes playlist-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
