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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
}

header {
    background: #2c3e50;
    color: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2em;
    font-weight: 600;
}

.location-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9em;
}

.location-info select {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    font-size: 0.95em;
}

section {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

h3 {
    color: #34495e;
    margin: 25px 0 15px 0;
    font-size: 1.2em;
}

h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1em;
}

/* Epoch显示区域 */
.epoch-section {
    background: #ecf0f1;
    text-align: center;
}

.epoch-display {
    margin: 20px 0;
}

.epoch-value {
    font-size: 3em;
    font-weight: bold;
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.epoch-info {
    margin-top: 15px;
}

.epoch-info p {
    font-size: 1.1em;
    color: #555;
    margin: 5px 0;
}

/* 转换器部分 */
.converter-section {
    background: white;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-row label {
    font-weight: 600;
    min-width: 80px;
}

.input-row input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.input-row input:focus {
    outline: none;
    border-color: #3498db;
}

button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.secondary-btn {
    background: #95a5a6;
}

.secondary-btn:hover {
    background: #7f8c8d;
}

.format-options {
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.format-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.format-options input[type="radio"] {
    cursor: pointer;
}

/* 日期时间输入网格 */
.datetime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.datetime-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.datetime-row label {
    font-weight: 600;
    font-size: 0.9em;
}

.datetime-row input,
.datetime-row select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.datetime-row input:focus,
.datetime-row select:focus {
    outline: none;
    border-color: #3498db;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 结果框 */
.result-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    min-height: 80px;
}

.result-box .placeholder {
    color: #999;
    font-style: italic;
}

.result-box p {
    margin: 8px 0;
    line-height: 1.8;
}

.result-box strong {
    color: #2c3e50;
}

/* 广告位 */
.ad-placeholder {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    margin: 20px 0;
}

.ad-placeholder img {
    max-width: 100%;
    height: auto;
}

/* 信息部分 */
.info-section {
    background: white;
}

.info-section p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.8;
}

/* 示例表格 */
.example-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

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

.example-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.example-table tr:nth-child(even) {
    background: #f8f9fa;
}

.example-table tr:hover {
    background: #e9ecef;
}

/* 换算网格 */
.conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.conversion-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.conversion-item strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.conversion-item span {
    color: #666;
}

/* 代码示例 */
.code-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
}

.code-block h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.code-block pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

/* 高亮框 */
.highlight-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.highlight-box p {
    margin: 8px 0;
    color: #856404;
}

.highlight-box strong {
    color: #856404;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
}

/* 移动端适配 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }

    section {
        padding: 20px;
    }

    .epoch-value {
        font-size: 2em;
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .input-row label {
        min-width: auto;
    }

    .input-row input,
    .input-row button {
        width: 100%;
    }

    .datetime-grid {
        grid-template-columns: 1fr 1fr;
    }

    .button-row {
        flex-direction: column;
    }

    .button-row button {
        width: 100%;
    }

    .conversion-grid {
        grid-template-columns: 1fr;
    }

    .code-examples {
        grid-template-columns: 1fr;
    }

    .example-table {
        font-size: 0.9em;
    }

    .example-table th,
    .example-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.3em;
    }

    section {
        padding: 15px;
    }

    .epoch-value {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    .datetime-grid {
        grid-template-columns: 1fr;
    }
}
