/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航栏样式 */
.navbar {
    background: #2c3e50;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 10px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-user {
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* 主要内容区域 */
.main-content {
    padding: 30px;
    min-height: 500px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
}

/* 表单样式 */
form {
    margin: 25px 0;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    box-shadow: 0 4px 15px rgba(255, 216, 155, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(255, 216, 155, 0.4);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* 列表样式 */
ul, ol {
    margin: 15px 0;
    padding-left: 30px;
}

li {
    margin: 8px 0;
}

/* 消息提示样式 */
.flash-messages {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.flash-messages.success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-left: 4px solid #2ecc71;
}

.flash-messages.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border-left: 4px solid #e74c3c;
}

.flash-messages.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-left: 4px solid #3498db;
}

/* 链接样式 */
a {
    color: #4facfe;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #00f2fe;
    text-decoration: underline;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .navbar {
        flex-direction: column;
        padding: 15px;
    }
    
    .nav-links {
        margin: 15px 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 5px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 8px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 图标样式 */
.icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 25px 0;
}

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-radius: 0 0 15px 15px;
}

.footer a {
    color: #4facfe;
}

/* 特殊组件样式 */

/* 下载卡片 */
.download-card {
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.3s ease;
    background: white;
}

.download-card:hover {
    border-color: #4facfe;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.download-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.download-card .filename {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}

/* 指标卡片 */
.indicator-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #4facfe;
}

.indicator-card.expired {
    border-left-color: #ff6b6b;
    opacity: 0.8;
}

.indicator-card .status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.indicator-card .status.active {
    background: #43e97b;
    color: white;
}

.indicator-card .status.expired {
    background: #ff6b6b;
    color: white;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.stats-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

/* 表单行 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* 已使用免费延期按钮样式 */
.btn-disabled {
    background-color: #95a5a6 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    border: none !important;
    opacity: 0.8;
    box-shadow: none !important;
    transform: none !important;
}

.btn-disabled:hover {
    background-color: #95a5a6 !important;
    color: #7f8c8d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* 灰色按钮样式 */
.btn-gray {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(189, 195, 199, 0.3) !important;
}

.btn-gray:hover {
    box-shadow: 0 6px 20px rgba(189, 195, 199, 0.4) !important;
}