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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #333;
    border-left: 4px solid #dc3545;
    padding-left: 15px;
    font-size: 24px;
}

.user-info {
    color: #666;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
}

.user-info a {
    color: #007bff;
    text-decoration: none;
    margin: 0 5px;
}

.user-info a:hover {
    text-decoration: underline;
}

.remaining-count {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
}

/* 统计区域 */
.stats-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

/* 功能卡片 */
.features {
    margin: 40px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-item {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.feature-item h3 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 20px;
}

/* 功能卡片（用户中心） */
.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.function-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.function-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.function-card p {
    color: #666;
    margin-bottom: 20px;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-calc, .btn-history, .btn-back, .btn-submit {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-calc {
    background: #28a745;
    color: white;
}

.btn-calc:hover {
    background: #218838;
}

.btn-history {
    background: #007bff;
    color: white;
}

.btn-history:hover {
    background: #0056b3;
}

.btn-back {
    background: #6c757d;
    color: white;
}

.btn-back:hover {
    background: #5a6268;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    font-size: 16px;
}

.btn-submit:hover {
    background: #0056b3;
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-disabled {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: not-allowed;
}

/* 认证框（登录/注册） */
.auth-box {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

.form-group textarea {
    font-family: monospace;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* 验证码组 */
.captcha-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-group input {
    flex: 1;
}

.captcha-img {
    width: 120px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.code-group {
    display: flex;
    gap: 10px;
}

.code-group input {
    flex: 2;
}

.btn-code {
    flex: 1;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-code:hover {
    background: #218838;
}

.btn-code:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 计算结果 */
.result-box {
    background: #d4edda;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.result-zodiacs {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zodiac-tag {
    display: inline-block;
    padding: 8px 20px;
    background: #007bff;
    color: white;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
}

.result-numbers {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 16px;
    word-break: break-all;
    border: 1px solid #ddd;
}

/* 历史记录表 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.history-table th,
.history-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.history-table th {
    background: #f2f2f2;
    font-weight: 600;
}

.history-table .hit {
    background: #d4edda;
}

.history-table .miss {
    background: #f8d7da;
}

.numbers-cell {
    max-width: 300px;
    word-break: break-all;
    font-size: 12px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.history-note {
    margin-bottom: 20px;
    color: #666;
}

.no-data {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    color: #999;
}

/* 提示框 */
.note {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.note ul {
    margin-top: 10px;
    margin-left: 20px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* 示例颜色 */
.hit-example {
    color: #155724;
    background: #d4edda;
    padding: 2px 8px;
    border-radius: 4px;
}

.miss-example {
    color: #721c24;
    background: #f8d7da;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 响应式 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stats-grid,
    .feature-grid,
    .function-grid {
        grid-template-columns: 1fr;
    }
    
    .captcha-group {
        flex-direction: column;
    }
    
    .captcha-img {
        width: 100%;
    }
    
    .history-table {
        font-size: 12px;
    }
    
    .history-table th,
    .history-table td {
        padding: 6px;
    }
}