/* 行星时计算器 - 古典欧式风格 */

:root {
    --primary-color: #8b7d6b;
    --secondary-color: #4a3c2c;
    --accent-color: #c19a6b;
    --light-color: #f4f1ea;
    --dark-color: #2c2518;
    --border-color: #d2c5b0;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --gold: #d4af37;
    
    --day-color: #f8d568;
    --night-color: #5d6e91;
    
    --sun-color: #e6a23c;
    --moon-color: #b4c6e7;
    --mars-color: #d64550;
    --mercury-color: #7fb7be;
    --jupiter-color: #7261a3;
    --venus-color: #d1b48c;
    --saturn-color: #5c5552;
}

/* 引入中文字体 */
@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/notoserifsc/v22/H4chBXePl9DZ0Xe7gG9cyOj7oqP7.otf) format('opentype');
    unicode-range: U+4E00-9FFF, U+3400-4DBF; /* 仅应用于中文字符 */
}

@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/notoserifsc/v22/H4c8BXePl9DZ0Xe7gG9cyOj7mm63SzZBEtE.otf) format('opentype');
    unicode-range: U+4E00-9FFF, U+3400-4DBF; /* 仅应用于中文字符 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

html {
    font-size: 16px; /* 基础字体大小 */
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    background-image: url('https://www.transparenttextures.com/patterns/parchment.png');
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 仅对中文应用中文字体 */
:lang(zh-CN) {
    font-family: 'Noto Serif SC', 'Cormorant Garamond', Georgia, serif;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px var(--shadow-color);
    padding: 30px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold), var(--accent-color));
}

/* 标题样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.logo-container {
    margin-bottom: 15px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

header::after {
    content: '✧';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 15px;
    color: var(--gold);
    font-size: 1.5rem;
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
    color: var(--secondary-color);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 400;
    letter-spacing: 2px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 0 auto;
}

h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* 位置信息 */
.location-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(244, 241, 234, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.location-display {
    font-size: 1.1rem;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* 时间信息 */
.time-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(244, 241, 234, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.current-time {
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.sun-info {
    display: flex;
    gap: 20px;
}

.sun-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.sun-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
}

.sunrise {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e6a23c"><path d="M12 2L8 6h3v6h2V6h3L12 2zm0 10c-2.76 0-5 2.24-5 5h10c0-2.76-2.24-5-5-5zm8 7H4v2h16v-2z"/></svg>');
}

.sunset {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e6a23c"><path d="M12 22L8 18h3v-6h2v6h3L12 22zm0-10c-2.76 0-5-2.24-5-5h10c0 2.76-2.24 5-5 5zm8-7H4v2h16V5z"/></svg>');
}

/* 日期选择器 */
.date-selector {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-selector label {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.date-selector input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
}

/* 当前行星时 */
.current-hour {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(244, 241, 234, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
}

.current-hour-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

#current-hour-time {
    font-size: 1.4rem;
    font-weight: bold;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.planet-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.planet-symbol {
    font-size: 2.5rem;
    color: var(--accent-color);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.planet-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.hour-period {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
}

.hour-period.day {
    background-color: var(--day-color);
    color: var(--dark-color);
}

.hour-period.night {
    background-color: var(--night-color);
    color: white;
}

/* 行星时表格 */
.hours-table {
    margin-bottom: 40px;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

thead {
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: rgba(244, 241, 234, 0.7);
}

tr.current-row {
    background-color: rgba(193, 154, 107, 0.2);
    font-weight: bold;
}

/* 行星信息卡片 */
.planets-info {
    margin-bottom: 40px;
}

.planets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.planet-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.planet-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(244, 241, 234, 0.7);
}

.planet-title {
    margin-left: 15px;
}

.planet-title h4 {
    margin-bottom: 0;
}

.planet-title span {
    color: var(--primary-color);
    font-style: italic;
}

.planet-attributes {
    padding: 15px;
    background-color: white;
}

.planet-day {
    margin-top: 10px;
    font-weight: bold;
    color: var(--secondary-color);
}

/* 行星颜色 */
.planet-card[data-planet="sun"] .planet-symbol {
    color: var(--sun-color);
}

.planet-card[data-planet="moon"] .planet-symbol {
    color: var(--moon-color);
}

.planet-card[data-planet="mars"] .planet-symbol {
    color: var(--mars-color);
}

.planet-card[data-planet="mercury"] .planet-symbol {
    color: var(--mercury-color);
}

.planet-card[data-planet="jupiter"] .planet-symbol {
    color: var(--jupiter-color);
}

.planet-card[data-planet="venus"] .planet-symbol {
    color: var(--venus-color);
}

.planet-card[data-planet="saturn"] .planet-symbol {
    color: var(--saturn-color);
}

/* 传统应用 */
.magical-uses {
    margin-bottom: 40px;
}

.uses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.use-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    text-align: center;
    transition: transform 0.3s;
}

.use-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

/* 页脚 */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    html {
        font-size: 14px; /* 移动端字体稍微小一点 */
    }
    
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 6px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    .time-info, .location-info {
        flex-direction: column;
        gap: 15px;
        padding: 12px;
    }
    
    .planets-grid, .uses-list {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
        max-height: 350px;
    }
    
    th, td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .planet-symbol {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .planet-name {
        font-size: 1.5rem;
    }
    
    .current-hour-display {
        gap: 8px;
    }
    
    #current-hour-time {
        font-size: 1.2rem;
    }
    
    /* 确保弹窗在移动端显示正常 */
    #follow-btn, #confirm-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .planet-card {
        border-radius: 6px;
    }
    
    .planet-header {
        padding: 10px;
    }
    
    .planet-attributes {
        padding: 10px;
    }
    
    .use-item {
        padding: 12px;
    }
} 