:root {
    --primary-color: #4a89dc;
    --secondary-color: #5d9cec;
    --danger-color: #da4453;
    --success-color: #8cc152;
    --warning-color: #f6bb42;
    --info-color: #3bafda;
    --light-color: #f5f7fa;
    --dark-color: #434a54;
    --gray-color: #aab2bd;
    --border-color: #e6e9ed;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #fff;
    --header-bg: #f5f7fa;
    --footer-bg: #f5f7fa;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* 夜间模式 */
[data-theme="dark"] {
    --primary-color: #5d9cec;
    --secondary-color: #4a89dc;
    --danger-color: #ed5565;
    --success-color: #a0d468;
    --warning-color: #ffce54;
    --info-color: #4fc1e9;
    --light-color: #656d78;
    --dark-color: #f5f7fa;
    --gray-color: #ccd1d9;
    --border-color: #656d78;
    --text-color: #f5f7fa;
    --bg-color: #2f3640;
    --card-bg: #353b48;
    --header-bg: #2f3640;
    --footer-bg: #2f3640;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg);
}

header h1 {
    margin: 0;
    color: var(--primary-color);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--footer-bg);
    color: var(--gray-color);
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.card-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.card-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.form-inline .form-group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-inline label {
    margin-bottom: 0;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-success {
    background-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-info {
    background-color: var(--info-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-icon {
    padding: 5px 10px;
    font-size: 18px;
    background: none;
    color: var(--primary-color);
}

.btn-icon:hover {
    background: none;
    color: var(--secondary-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-color);
}

.btn-close:hover {
    color: var(--danger-color);
}

.btn-disabled,
.btn:disabled {
    background-color: var(--gray-color);
    cursor: not-allowed;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--header-bg);
    font-weight: bold;
}

.table tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
}

/* 加载指示器 - 进度条样式 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    z-index: 1000;
    display: none;
}

.loading-indicator::before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% {
        left: 0;
        width: 0;
    }
    50% {
        left: 0;
        width: 100%;
    }
    100% {
        left: 100%;
        width: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 公告样式 */
.announcement {
    background-color: var(--warning-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.announcement-header h3 {
    margin: 0;
}

.announcement-content {
    line-height: 1.6;
}

/* 提醒样式 */
.reminder {
    background-color: #FF8C00;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: white;
}

.reminder h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: white;
}

.reminder p {
    margin-bottom: 15px;
    color: white;
}

.reminder .btn {
    background-color: white;
    color: #FF8C00;
    border: none;
}

.reminder .btn:hover {
    background-color: #f0f0f0;
}

/* 卡密信息样式 */
.card-key-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.card-key-info-item:last-child {
    border-bottom: none;
}

/* 小说结果样式 */
.novel-result {
    text-align: center;
    padding: 20px;
}

.novel-result h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.novel-result p {
    margin-bottom: 15px;
}

.cache-notice {
    color: var(--success-color);
    font-style: italic;
    margin-bottom: 15px;
}

/* 错误消息 */
.error-message {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.error {
    color: var(--danger-color);
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* 下载成功提示 */
.download-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-icon {
    font-size: 20px;
    font-weight: bold;
}

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

/* VIP徽章样式 */
/* VIP徽章基础样式 */
.vip-badge {
    /* 布局与盒模型 */
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px; /* 大圆角营造现代感 */
    
    /* 视觉样式 */
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #ffa726); /* 保留原有的渐变色 */
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    
    /* 交互样式 */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateY(0);
    
    /* 关键：为伪元素提供定位上下文 */
    position: relative;
    overflow: hidden; /* 隐藏超出徽章范围的闪光效果 */
}

/* VIP徽章 hover 与 active 状态 */
.vip-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.vip-badge:active {
    transform: translateY(0);
}

/* VIP徽章中的图标样式 */
.vip-badge i {
    font-size: 12px;
    /* 确保图标在闪光效果之上 */
    position: relative;
    z-index: 1;
}

/* VIP徽章的文字样式 */
.vip-badge span {
    /* 确保文字在闪光效果之上 */
    position: relative;
    z-index: 1;
}

/* 闪光效果的伪元素 */
.vip-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    /* 关键：应用闪光动画 */
    animation: shine 3s infinite linear;
    /* 初始状态下，闪光条在徽章左侧外部 */
    transform: skewX(-25deg) translateX(-150%);
}

/* 定义闪光动画 */
@keyframes shine {
    100% {
        /* 动画结束时，闪光条移动到徽章右侧外部 */
        transform: skewX(-25deg) translateX(300%);
    }
}
/* 已验证卡密样式 */
.verified-card-key {
    color: #ff0000;
    font-weight: bold;
    font-size: 16px;
}

/* 小说名字样式 */
.novel-title {
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 10px 15px;
    background: linear-gradient(45deg, #fff9c4, #fffde7);
    color: #333;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* 章节数样式 */
.chapter-count {
    color: #ff0000;
    font-weight: bold;
    font-size: 14px;
    margin: 5px 0;
}

/* 卡密信息项样式 */
.card-key-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.card-key-info-item:last-child {
    border-bottom: none;
}

.card-key-info-item span:first-child {
    font-weight: bold;
    color: var(--text-color);
}

.card-key-info-item span:last-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-buttons {
        margin-top: 15px;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-inline .form-group {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table th,
    .table td {
        padding: 8px 5px;
        font-size: 14px;
    }
    
    .download-success {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .vip-badge {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 移动端下载容器样式 */
.mobile-download-container {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.mobile-download-info h3 {
    margin-top: 0;
    color: var(--text-color);
}

.mobile-download-info p {
    margin: 10px 0;
    color: var(--text-color);
}

.download-link-container {
    margin: 15px 0;
}

.download-link-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.download-link-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.download-url-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 12px;
    box-sizing: border-box;
}

.download-tip {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    font-style: italic;
}

@media (max-width: 768px) {
    .download-link-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .download-url-input {
        font-size: 11px;
    }
}