/* public/style.css (最终修复版 + 模拟时钟) */

/* 全局 & 主题 */
:root {
    --bg-dark: #121212; --bg-light: #f0f2f5;
    --card-bg-dark: rgba(28, 28, 30, 0.7); --card-bg-light: rgba(255, 255, 255, 0.75);
    --text-dark: #e0e0e0; --text-light: #333333;
    --border-dark: rgba(255, 255, 255, 0.15); --border-light: rgba(0, 0, 0, 0.1);
    --primary-accent: #ff9800; --shadow: rgba(0,0,0,0.3);
    --overlay-color-dark: rgba(0, 0, 0, 0.55);
    --overlay-color-light: rgba(240, 242, 245, 0.3);
}
body {
    margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Helvetica Neue", "PingFang SC", "Microsoft Yahei", sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 0;

    background-image: url('/background-desktop.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    transition: background-color 0.5s ease;
}
body.theme-dark::before {
    background-color: var(--overlay-color-dark);
}
body.theme-light::before {
    background-color: var(--overlay-color-light);
}

body.theme-dark { color: var(--text-dark); }
body.theme-light { color: var(--text-light); }

h1,h3 { margin: 0; }
p { margin: 1em 0; }
h1,p,div,span {
    text-shadow: 0 0 5px rgba(0,0,0,0.5), 0 0 10px rgba(0,0,0,0.3);
}

#particles-js { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 0; }

/* 布局 & 头部 */
.container { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; padding: 80px 20px 40px; box-sizing: border-box; }
.site-header { position: fixed; top: 0; left: 0; width: 100%; padding: 15px 20px; display: flex; justify-content: space-between; z-index: 100; box-sizing: border-box; }
.header-btn {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.2); color: white;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
}
.header-btn:active { transform: scale(0.9); }
body.theme-light .header-btn { background: rgba(255,255,255,0.3); border-color: rgba(0,0,0,0.1); color: #333; }
.header-left, .header-right { display: flex; gap: 10px; }

#main-title { font-size: 2.5rem; margin-bottom: 0.5em; }

/* --- (新增) 模拟时钟样式 --- */
#analog-clock-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem; /* 与下方数字时钟的间距 */
    transition: opacity 0.5s;
}
.clock-face {
    stroke-width: 2;
    fill: none;
    transition: stroke 0.5s ease;
}
.clock-hand {
    stroke-linecap: round;
    transform-origin: 50px 50px; /* 设置旋转中心 */
    transition: transform 0.5s cubic-bezier(.4,2.08,.55,.44), stroke 0.5s ease; /* 平滑过渡效果 */
}
#hour-hand { stroke-width: 4; }
#minute-hand { stroke-width: 3; }
#second-hand {
    stroke-width: 2;
    stroke: var(--primary-accent); /* 秒针使用主题强调色 */
    /* 移除 transition 让秒针"跳动" */
    transition: transform 0.2s linear, stroke 0.5s ease;
}
body.theme-dark .clock-face { stroke: rgba(255, 255, 255, 0.4); }
body.theme-dark .clock-hand { stroke: rgba(255, 255, 255, 0.8); }
body.theme-light .clock-face { stroke: rgba(0, 0, 0, 0.2); }
body.theme-light .clock-hand { stroke: rgba(0, 0, 0, 0.6); }
/* -------------------------- */

.content-section {
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 15px; padding: 25px; width: 100%; max-width: 600px;
    box-shadow: 0 4px 20px var(--shadow); margin-top: 1.5rem;
    transition: all 0.5s ease;
}
/* ... (后续所有 CSS 规则保持不变) ... */
body.theme-dark .content-section { background: var(--card-bg-dark); border: 1px solid var(--border-dark); }
#timer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 1.5rem 0; }
.time-block { padding: 10px 15px; border-radius: 10px; min-width: 70px; }
.time-block span { font-size: 2.5rem; font-weight: bold; display: block; }
.time-block label { font-size: 0.8rem; opacity: 0.8; }
#hitokoto-wrapper { padding: 15px 25px; border-radius: 8px; max-width: 90%; font-style: italic; }
#hitokoto-text { margin: 0; } #hitokoto-from { margin: 5px 0 0; text-align: right; font-size: 0.9em; opacity: 0.8; }
input, textarea, button { font-family: inherit; border-radius: 8px; padding: 12px 15px; font-size: 1rem; width: 100%; box-sizing: border-box; border: 1px solid transparent; }
input, textarea { background-color: rgba(255, 255, 255, 0.9); color: #333; margin-bottom: 10px; }
textarea { resize: vertical; min-height: 80px; }
button { background-color: var(--primary-accent); color: white; font-weight: bold; cursor: pointer; transition: all 0.3s; }
button:hover { filter: brightness(1.1); transform: translateY(-2px); }
button:disabled { background-color: #999; cursor: not-allowed; }
.hidden { display: none !important; }
#unlocked-content { width: 100%; max-width: 800px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.unlocked-content-visible { animation: fadeIn 0.5s ease-out forwards; }
.tabs { display: flex; gap: 10px; margin-top: 2rem; border-bottom: 1px solid; padding-bottom: 5px; flex-wrap: wrap; justify-content: center; }
body.theme-dark .tabs { border-bottom-color: var(--border-dark); }
body.theme-light .tabs { border-bottom-color: var(--border-light); }
.tab-link { color: inherit; opacity: 0.7; flex-grow: 1; flex-shrink: 0; text-align: center; padding: 10px 15px; font-size: 1rem; border-bottom: 3px solid transparent; transition: opacity 0.3s ease; }
.tab-link:hover { opacity: 1; }
.tab-link.active { font-weight: bold; border-bottom-color: var(--primary-accent); opacity: 1; }
.tab-content { padding-top: 20px; }
#photo-gallery { column-count: 3; column-gap: 10px; }
.gallery-item { margin-bottom: 10px; display: inline-block; width: 100%; border-radius: 8px; overflow: hidden; cursor: pointer; }
.gallery-item img { width: 100%; height: auto; display: block; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.05); }
#message-list { max-height: 400px; overflow-y: auto; padding-right: 10px; text-align: left; }
.message-item { padding: 15px; border-radius: 8px; margin-bottom: 10px; border-left: 4px solid var(--primary-accent); }
body.theme-dark .message-item { background: rgba(255,255,255,0.05); }
body.theme-light .message-item { background: rgba(0,0,0,0.02); }
.message-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.message-user { font-weight: bold; } .message-time { font-size: 0.8em; opacity: 0.7; }
.message-body { white-space: pre-wrap; word-wrap: break-word; }
.message-footer { text-align: right; margin-top: 10px; }
.like-btn { color: #ccc; font-size: 1rem; }
body.theme-light .like-btn { color: #888; }
.like-btn.liked, .like-btn:active { color: #e91e63; }
.like-btn .fas { margin-right: 5px; }
#loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #121212; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.spinner { border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: var(--primary-accent); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 768px) {
    body { background-image: url('/background-mobile.jpg'); }
    .container { padding: 70px 15px 30px; }
    #main-title { font-size: 2rem; }
    #analog-clock-container { width: 120px; height: 120px; } /* 在手机上缩小一点 */
    #timer { justify-content: center; max-width: 320px; margin-left: auto; margin-right: auto; }
    .time-block { flex: 1 1 40%; min-width: 120px; box-sizing: border-box; }
    .time-block span { font-size: 2rem; }
    .content-section { padding-left: 15px; padding-right: 15px; }
    #photo-gallery { column-count: 2; }
    #info-card { flex-direction: column; align-items: center; }
    #info-card > div { margin-left: 0 !important; margin-top: 15px; text-align: center !important; }
}