/* server.css - 明朝风格主题样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

:root {
    /* 亮色主题变量 */
    --bg-color: #f8f3e6;
    --text-color: #333;
    --card-bg: #fff;
    --header-bg: linear-gradient(to right, #8b0000, #a52a2a);
    --nav-bg: #8b0000;
    --accent-color: #8b0000;
    --gold-color: #d4af37;
    --border-color: #e0c987;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --code-bg: #2b2b2b;
    --time-bg: linear-gradient(135deg, #8b0000, #d4af37);
    --pattern-opacity: 0.05;
    --primary-color: #8b0000;
    --secondary-color: #d4af37;
    --display-bg: #f8f3e6;
    --btn-bg: #e8d5c0;
    --btn-operator-bg: #8b0000;
    --btn-equals-bg: #d4af37;
    --btn-clear-bg: #a52a2a;
}

.dark-mode {
    /* 暗色主题变量 */
    --bg-color: #1a1a1a;
    --text-color: #e6e6e6;
    --card-bg: #2d2d2d;
    --header-bg: linear-gradient(to right, #600000, #7a1f1f);
    --nav-bg: #600000;
    --accent-color: #cc0000;
    --gold-color: #c19b30;
    --border-color: #5c4c1a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --code-bg: #3d3d3d;
    --time-bg: linear-gradient(135deg, #600000, #9b7a1f);
    --pattern-opacity: 0.1;
    --primary-color: #cc0000;
    --secondary-color: #c19b30;
    --display-bg: #2d2d2d;
    --btn-bg: #3d3d3d;
    --btn-operator-bg: #600000;
    --btn-equals-bg: #9b7a1f;
    --btn-clear-bg: #7a1f1f;
}

body {
    font-family: 'SimSun', '宋体', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill-opacity="' + var(--pattern-opacity) + '" fill="%23000" width="100" height="100"/></svg>');
    padding: 0;
    margin: 0;
}

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

/* 页眉样式 */
header {
    background: var(--header-bg);
    color: #f8f3e6;
    padding: 20px 0;
    border-bottom: 5px solid var(--gold-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 5px;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* 导航样式 */
nav {
    background-color: var(--nav-bg);
    padding: 15px 0;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--gold-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: #f8f3e6;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.1rem;
    padding: 5px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主题切换按钮 */
.theme-switch {
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.theme-switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #f8f3e6;
    font-size: 0.9rem;
}

.theme-switch-label i {
    margin-right: 5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--gold-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 语言切换按钮 */
.language-switch {
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.language-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #f8f3e6;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主要内容区 */
.main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px var(--shadow-color);
    border-left: 5px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--accent-color), var(--gold-color));
}

.card h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--border-color);
    font-size: 1.5rem;
}

/* 图片容器 */
.image-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.image-container img {
    width: 100%;
    border: 3px solid var(--gold-color);
    border-radius: 5px;
    transition: transform 0.3s;
}

.image-container img:hover {
    transform: scale(1.03);
}

/* 链接样式 */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

a:hover {
    color: var(--gold-color);
}

a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--gold-color);
    transition: width 0.3s;
}

a:hover::after {
    width: 100%;
}

/* 代码块样式 */
pre {
    background: var(--code-bg);
    color: #f8f3e6;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border-left: 5px solid var(--gold-color);
    font-family: 'Consolas', 'Monaco', monospace;
    margin: 20px 0;
}

/* 侧边栏样式 */
.sidebar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px var(--shadow-color);
    border-left: 5px solid var(--gold-color);
}

.sidebar h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--border-color);
    text-align: center;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
}

.sidebar li:last-child {
    border-bottom: none;
}

/* 页脚样式 */
footer {
    background: var(--header-bg);
    color: #f8f3e6;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 5px solid var(--gold-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    nav a {
        display: block;
        margin: 10px 0;
    }
    
    .theme-switch, .language-switch {
        margin: 10px 0;
    }
}

/* 明朝特色装饰 */
.ming-decoration {
    font-family: 'KaiTi', '楷体', serif;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.chinese-pattern {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><path fill="' + var(--accent-color) + '" fill-opacity="0.1" d="M0 0h60v60H0z"/><path fill="' + var(--gold-color) + '" fill-opacity="0.1" d="M0 0h30v30H0z"/></svg>');
    background-size: 60px 60px;
}

/* 游戏卡片样式 */
.game-card {
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--border-color) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.2);
}

.game-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.game-card p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.game-btn {
    display: inline-block;
    background: var(--accent-color);
    color: #f8f3e6;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.game-btn:hover {
    background: var(--nav-bg);
}

/* 时间报时器样式 */
.time-display {
    background: var(--time-bg);
    color: #f8f3e6;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-family: 'KaiTi', '楷体', serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.time-display #current-time {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.time-display #current-date {
    font-size: 1.1rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* 计算器样式 */
.calculator-container {
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
    border: 4px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    position: relative;
    overflow: hidden;
    margin: 20px 0;
}

.calculator-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--border-color), var(--secondary-color), var(--border-color));
    border-bottom: 2px solid var(--primary-color);
}

.calculator-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--border-color), var(--secondary-color), var(--border-color));
    border-top: 2px solid var(--primary-color);
}

.calculator-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(255, 215, 0, 0.5);
    letter-spacing: 4px;
    position: relative;
}

.calculator-title::before, .calculator-title::after {
    content: "◆";
    color: var(--border-color);
    margin: 0 15px;
    font-size: 20px;
}

.calculator-display {
    background: var(--display-bg);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: right;
    font-size: 32px;
    min-height: 80px;
    box-shadow: inset 0 0 10px rgba(139, 69, 19, 0.3);
    font-family: 'SimHei', '黑体', sans-serif;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.calc-btn {
    background: var(--btn-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 0;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s;
    font-family: 'SimHei', '黑体', sans-serif;
    position: relative;
    overflow: hidden;
}

.calc-btn:hover {
    background: linear-gradient(to bottom, #e8d5c0, #d4a76a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.calc-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px var(--shadow-color);
}

.calc-operator {
    background: var(--btn-operator-bg);
    color: #f9f3e9;
    font-weight: bold;
}

.calc-equals {
    background: var(--btn-equals-bg);
    color: #f9f3e9;
    font-weight: bold;
    grid-column: span 2;
}

.calc-clear {
    background: var(--btn-clear-bg);
    color: #f9f3e9;
    font-weight: bold;
}

.calculator-decoration {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.calculator-decoration span {
    font-size: 24px;
    color: var(--border-color);
}

/* 历史卡片样式 */
.history-card {
    background: linear-gradient(135deg, #f8f3e6 0%, #e0c987 100%);
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(139, 0, 0, 0.15);
}

.dark-mode .history-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #5c4c1a 100%);
}

.history-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--accent-color), var(--gold-color));
}

.history-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid var(--gold-color);
    padding-bottom: 10px;
}

.history-card p {
    margin-bottom: 15px;
    line-height: 1.8;
    text-align: justify;
}

.history-btn {
    display: inline-block;
    background: var(--accent-color);
    color: #f8f3e6;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid transparent;
    margin-top: 10px;
}

.history-btn:hover {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

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

.history-feature {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.dark-mode .history-feature {
    background: rgba(45, 45, 45, 0.7);
}

.history-feature i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.history-feature h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

/* 访问量统计样式 */
.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-family: 'KaiTi', '楷体', serif;
}

.dark-mode .visitor-counter {
    background: rgba(0, 0, 0, 0.2);
}

.visitor-counter span {
    margin-right: 10px;
    color: var(--gold-color);
    font-weight: bold;
}

.visitor-counter img {
    height: 20px;
    vertical-align: middle;
}

/* 贪吃蛇游戏样式 */
.snake-game-container {
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--border-color) 100%);
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 16px rgba(139, 0, 0, 0.15);
}

.snake-game-container h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid var(--gold-color);
    padding-bottom: 10px;
}

.snake-game-board {
    display: inline-block;
    border: 3px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 8px var(--shadow-color);
    margin: 15px 0;
}

.snake-game-info {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-family: 'KaiTi', '楷体', serif;
}

.snake-game-score {
    background: var(--accent-color);
    color: #f8f3e6;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
}

.snake-game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.snake-game-btn {
    background: var(--accent-color);
    color: #f8f3e6;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    font-family: 'SimSun', '宋体', serif;
}

.snake-game-btn:hover {
    background: var(--nav-bg);
}

.snake-game-instructions {
    margin-top: 15px;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid var(--gold-color);
}

.dark-mode .snake-game-instructions {
    background: rgba(0, 0, 0, 0.1);
}

.snake-game-instructions h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.snake-game-instructions ul {
    padding-left: 20px;
}

.snake-game-instructions li {
    margin-bottom: 5px;
}

/* 每日打卡样式 */
.daily-checkin-card {
    background: linear-gradient(135deg, #f8f3e6 0%, #e0c987 100%);
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(139, 0, 0, 0.15);
}

.dark-mode .daily-checkin-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #5c4c1a 100%);
}

.daily-checkin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--accent-color), var(--gold-color));
}

.daily-checkin-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid var(--gold-color);
    padding-bottom: 10px;
}

.checkin-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    text-align: center;
}

.checkin-stat {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.dark-mode .checkin-stat {
    background: rgba(45, 45, 45, 0.7);
}

.checkin-stat h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

.checkin-stat p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold-color);
}

.fortune-result {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    border: 2px solid var(--border-color);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dark-mode .fortune-result {
    background: rgba(45, 45, 45, 0.8);
}

.fortune-level {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'KaiTi', '楷体', serif;
}

.fortune-message {
    font-size: 1.1rem;
    color: var(--text-color);
    font-style: italic;
}

.fortune-daxiong {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.fortune-xiong {
    color: #ff6b6b;
}

.fortune-zhongping {
    color: #ffa500;
}

.fortune-xiaoji {
    color: #32cd32;
}

.fortune-daji {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.checkin-btn {
    display: block;
    background: var(--accent-color);
    color: #f8f3e6;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid transparent;
    margin: 20px auto 0;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: 'SimSun', '宋体', serif;
}

.checkin-btn:hover {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.checkin-btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.checkin-btn:disabled:hover {
    background: #cccccc;
    border-color: transparent;
    color: #666666;
}

.checkin-history {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dark-mode .checkin-history {
    background: rgba(45, 45, 45, 0.5);
}

.checkin-history h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    text-align: center;
}

.checkin-history ul {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.checkin-history li {
    padding: 8px 0;
    border-bottom: 1px dotted var(--border-color);
    display: flex;
    justify-content: space-between;
}

.checkin-history li:last-child {
    border-bottom: none;
}

.checkin-date {
    color: var(--text-color);
}

.checkin-fortune {
    font-weight: bold;
}
