* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-color: #f6f6f6;
    --text-color: #202122;
    --card-bg: #fff;
    --border-color: #a7d7f9;
    --link-color: #0645ad;
    --btn-bg: #f8f9fa;
    --btn-border: #a2a9b1;
}
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #444;
    --link-color: #8ab4f8;
    --btn-bg: #3d3d3d;
    --btn-border: #555;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
}
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    min-height: 100vh;
}
.site-header {
    background: var(--card-bg);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.page-bar-header {
    padding: 8px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: #72777d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-color);
}
.site-header h1 {
    font-size: 18px;
    font-weight: normal;
    font-family: "Linux Libertine", Georgia, Times, serif;
    color: var(--text-color);
}
.site-header h1 a { color: var(--text-color); text-decoration: none; }
.site-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}
.site-nav a, .site-nav button {
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: background 0.15s;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.theme-btn {
    background: var(--btn-bg);
    border-color: var(--btn-border) !important;
}
    white-space: nowrap;
}
.site-nav a:hover {
    background: #eaecf0;
    text-decoration: none;
}
.page-bar-header {
    padding: 8px 24px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: #72777d;
    white-space: nowrap;
    overflow-x: auto;
}
.page-bar-footer {
    padding: 12px 24px;
    font-size: 12px;
    color: #72777d;
}

.main-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 32px 48px;
}

.page-title {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 28px;
    font-weight: normal;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 8px;
    margin-bottom: 8px;
    color: var(--text-color);
}
.page-subtitle {
    font-size: 13px;
    color: #72777d;
    margin-bottom: 24px;
}

.section-heading {
    font-family: "Linux Libertine", Georgia, Times, serif;
    font-size: 22px;
    font-weight: normal;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 4px;
    margin: 32px 0 16px 0;
    color: var(--text-color);
}
.section-num {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    background: #a2a9b1;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin-right: 8px;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- 刷新时间 / 访问计数 (隐藏到页面底部) --- */
#refresh-time, #visit-count-corner { display: none; }
.page-bar-footer {
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: #72777d;
    text-align: center;
}
.page-footer {
    padding: 12px 24px;
    font-size: 12px;
    color: #72777d;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- 新闻链接 --- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}
.tag-subheading {
    font-size: 12px;
    font-weight: bold;
    color: #54595d;
    margin-top: 12px;
}
.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}
.ai-group {
    min-width: 0;
}
.tag-link {
    display: inline-block;
    font-size: 13px;
    padding: 3px 10px;
    border: 1px solid var(--btn-border);
    border-radius: 2px;
    color: var(--link-color);
    text-decoration: none;
    background: var(--btn-bg);
    transition: background 0.15s, border-color 0.15s;
}
.tag-link:hover {
    background: var(--btn-bg);
    border-color: var(--link-color);
    text-decoration: none;
}

/* --- 时区图 --- */
.timezone-map { width: 100%; max-width: 100%; margin: 0 auto; position: relative; }
.world-map-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: #0d1b2a;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #a2a9b1;
}
.world-map-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: brightness(0.6) sepia(0.3) hue-rotate(180deg);
    z-index: 1;
}
.timezone-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; z-index: 2; }
.timezone-column { flex: 1; position: relative; transition: background-color 0.5s ease; border-right: 1px solid rgba(0,0,0,0.15); }
.timezone-column:last-child { border-right: none; }
.city-marker { position: absolute; font-size: 10px; color: white; white-space: nowrap; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); z-index: 10; }
.city-dot { width: 6px; height: 6px; background: #ff6b6b; border-radius: 50%; position: absolute; z-index: 10; box-shadow: 0 0 5px #ff6b6b; }
.timezone-label { display: flex; justify-content: space-between; font-size: 12px; color: #54595d; padding: 8px 4px; background: #f8f9fa; border: 1px solid #a2a9b1; border-top: none; }
.map-title { font-size: 14px; margin-bottom: 8px; color: #54595d; }
.day-indicator { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 9px; color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 3px; }

/* --- 时钟 --- */
.clocks-container {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 12px 0;
    gap: 12px 20px;
}
.clock-wrapper { text-align: center; margin: 4px; }
.clock-city { font-size: 13px; font-weight: bold; color: var(--text-color); margin-bottom: 2px; }
.clock-time { font-size: 28px; font-weight: bold; color: var(--text-color); font-family: "Linux Libertine", Georgia, Times, serif; }
.clock-tz { font-size: 11px; color: #72777d; margin-top: 1px; }
.clock-date { font-size: 11px; color: #72777d; margin-top: 1px; }
.clock-wrapper.beijing .clock-city { color: #c41e3a; font-weight: bold; }
.clock-wrapper.beijing .clock-time { color: #c41e3a; font-size: 32px; }

/* --- 随机字符串 --- */
.display {
    font-size: 28px;
    font-weight: bold;
    margin: 8px 0;
    font-family: "Courier New", monospace;
    color: #202122;
    background: #f8f9fa;
    border: 1px solid #eaecf0;
    padding: 8px 24px;
    display: inline-block;
    border-radius: 2px;
}
.random-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.random-item { text-align: center; }
.random-label { font-size: 13px; color: #72777d; margin-bottom: 4px; }
.random-bar { font-size: 12px; color: #72777d; text-align: center; margin: 8px 0; overflow: hidden; white-space: nowrap; }
.random-bar-header { font-size: 12px; color: #72777d; }
.random-bar-footer { font-size: 12px; color: #72777d; margin-left: 16px; }
.random-compact { display: flex; align-items: center; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.random-compact span:first-child {
    font-size: 13px;
    color: #72777d;
}
.random-compact .random-value {
    font-family: "Courier New", monospace;
    font-size: 18px;
    font-weight: bold;
    background: var(--btn-bg);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-color);
    min-width: 100px;
    text-align: center;
    transition: background 0.15s;
}
.random-compact .random-value:hover {
    background: var(--border-color);
}
.mini-btn {
    background: var(--link-color);
    border: none;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    color: #fff;
    transition: opacity 0.15s;
}
.mini-btn:hover {
    opacity: 0.85;
}
.random-compact .random-value:hover {
    background: var(--border-color);
}
.mini-btn:hover {
    opacity: 0.85;
}
.random-bar-header { display: none; }
.random-bar-footer { display: none; }

/* --- 按钮 --- */
.wiki-btn {
    background: #f8f9fa;
    color: #202122;
    border: 1px solid #a2a9b1;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s;
    font-family: inherit;
}
.wiki-btn:hover {
    background: #eaecf0;
}

/* --- 记忆翻牌游戏 --- */
.game-controls {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.game-stats {
    font-size: 14px;
    color: #202122;
    font-weight: bold;
}
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 360px;
    margin: 0 auto;
    padding: 8px;
}
.card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    background: transparent;
}
.card.flipped { transform: rotateY(180deg); }
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-size: 36px;
    border: 1px solid #a2a9b1;
}
.card-front {
    background: #eaf3ff;
    transform: rotateY(180deg);
}
.card-back {
    background: #f8f9fa;
    color: #72777d;
    font-size: 24px;
}
.card.matched { pointer-events: none; }
.card.matched .card-front {
    background: #d5fdd5;
    border-color: #8cda8c;
    transform: rotateY(0deg);
}
.card.matched .card-back { display: none; }
.game-message {
    margin-top: 16px;
    font-size: 20px;
    font-weight: bold;
    color: #14532d;
    min-height: 28px;
    text-align: center;
}

/* --- 商品价格 --- */
.price-cards {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.price-card {
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 20px 32px;
    text-align: center;
    color: #202122;
    min-width: 200px;
    transition: box-shadow 0.2s;
}
.price-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.price-icon { font-size: 36px; margin-bottom: 8px; }
.price-name { font-size: 16px; font-weight: bold; margin-bottom: 12px; }
.price-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}
.price-change {
    font-size: 16px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 8px;
}
.price-change.positive { background: #d5fdd5; color: #14532d; border: 1px solid #8cda8c; }
.price-change.negative { background: #fce8e8; color: #b91c1c; border: 1px solid #f5a6a6; }
.price-unit { font-size: 13px; color: #72777d; }
.price-update-time { font-size: 13px; color: #54595d; text-align: center; }
.price-data-source { font-size: 12px; color: #72777d; text-align: center; margin-top: 4px; font-style: italic; }
.price-flash-up { animation: flashGreen 0.5s ease; }
.price-flash-down { animation: flashRed 0.5s ease; }
@keyframes flashGreen {
    0%, 100% { color: #202122; }
    50% { color: #14532d; }
}
@keyframes flashRed {
    0%, 100% { color: #202122; }
    50% { color: #b91c1c; }
}

/* --- AI 助手快捷入口 --- */
.ai-tools-hint {
    font-size: 12px;
    color: #72777d;
    margin-bottom: 12px;
}
.ai-tools-group {
    margin-bottom: 16px;
}
.ai-group-label {
    font-size: 13px;
    font-weight: bold;
    color: #54595d;
    margin-bottom: 8px;
    padding-left: 2px;
}
.ai-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.ai-pair {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #c8c8c8;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.ai-pair:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}
.ai-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s;
}
.ai-btn:hover {
    text-decoration: none;
}
.ai-chat {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.ai-chat:hover {
    background: #333;
}
.ai-admin {
    background: #f0f0f0;
    color: #444;
    padding: 8px 12px;
    font-weight: 500;
    font-size: 12px;
    border-left: 1px solid #c8c8c8;
}
.ai-admin:hover {
    background: #e2e2e2;
}

/* --- 哈希计算器 --- */
.hash-input-row { margin: 12px 0; }
.hash-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
}
.hash-quick-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    flex-wrap: wrap;
}
.hash-quick-input {
    width: 200px;
    min-width: 140px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
}
.hash-quick-value {
    flex: 1;
    min-width: 80px;
    border: 1px solid var(--btn-border);
    border-radius: 3px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    cursor: pointer;
    transition: background 0.15s;
}
.hash-quick-value.short {
    max-width: 100px;
}
.hash-quick-value {
    flex: 1;
    min-width: 80px;
    border: 1px solid var(--btn-border);
    border-radius: 3px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}
.hash-quick-row .hash-label {
    min-width: auto;
    font-size: 12px;
    white-space: nowrap;
}
.encrypt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    flex-wrap: wrap;
}
.encrypt-input-long {
    flex: 1;
    min-width: 200px;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
}
.encrypt-key-short {
    width: 80px;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
}
.encrypt-cmd {
    margin-top: 8px;
    font-size: 12px;
    color: #72777d;
}
.encrypt-cmd code {
    font-family: monospace;
    background: var(--btn-bg);
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.encrypt-cmd code:hover {
    background: var(--border-color);
}
.hash-cmd-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cmd-right {
    margin-left: auto !important;
}
.hash-results { display: flex; flex-direction: column; gap: 20px; }
.hash-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--btn-bg);
    border-radius: 4px;
}
.hash-label { font-weight: bold; min-width: 100px; white-space: nowrap; }
.hash-value {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--btn-border);
    border-radius: 3px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}
.hash-value:focus {
    border-color: var(--border-color);
}
.hash-cmd-group {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 80px;
    margin-top: 8px;
}
.hash-cmd {
    font-family: monospace;
    font-size: 11px;
    color: #72777d;
    cursor: pointer;
}
.hash-cmd:hover {
    color: var(--link-color);
}
.copy-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-color);
}
.copy-btn:hover { background: var(--border-color); }

/* --- 响应式 --- */
@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .site-header { padding: 8px 16px; }
    .site-nav { margin-left: 0; }
    .clock-svg { width: 140px; height: 140px; }
    .memory-game { max-width: 280px; }
    .ai-tools-grid { gap: 6px; }
    .ai-chat { padding: 6px 10px; font-size: 12px; }
    .ai-admin { padding: 6px 8px; font-size: 11px; }
}
