/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;  /* Safari */
    -ms-user-select: none;      /* IE 10 and IE 11 */
    user-select: none;          /* Standard syntax */
}

/* 允許輸入框可以選取 */
input, textarea, select {
    -webkit-user-select: text;  /* Safari */
    -ms-user-select: text;      /* IE 10 and IE 11 */
    user-select: text;          /* Standard syntax */
}

/* 基本樣式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #121416;
    background-color: #f5f7fa;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* 頁首 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    border-bottom: 1px solid #f1f2f4;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 1rem;
    height: 1rem;
    color: currentColor;
}

.logo h1 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.nav a {
    color: #121416;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.help-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background-color: #f1f2f4;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #121416;
}

/* 主要內容 */
.main {
    flex: 1 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    background-color: #f5f7fa;
}

.description {
    width: 100%;
    max-width: 80%;
    text-align: center;
    margin-bottom: -1rem;
}

.description blockquote {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.description blockquote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(245, 158, 11, 0.4), rgba(245, 158, 11, 0.1));
}

.description blockquote p {
    color: #4b5563;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.description blockquote p:first-child {
    margin-bottom: 0.75rem;
}

.description blockquote p:last-child {
    color: #6b7280;
    font-size: 1rem;
}

.section {
    width: 100%;
    max-width: 80%;
    margin-bottom: 1rem;
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

#timestamp-to-datetime::before {
    background: linear-gradient(to right, #3b82f6, #60a5fa);
}

#datetime-to-timestamp::before {
    background: linear-gradient(to right, #10b981, #34d399);
}

.section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: #1f2937;
    position: relative;
    padding-bottom: 1rem;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: #e5e7eb;
}

/* 輸入區域 */
.input-group, .datetime-inputs {
    max-width: 80%;
    margin: 0 auto;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-row input {
    width: 80px;
    text-align: center;
}

.input-row input[placeholder="Year"] {
    width: 100px;
}

.separator {
    color: #6a7681;
    font-size: 1.25rem;
    font-weight: 500;
    padding: 0 0.25rem;
}

.separator-space {
    width: 2rem;
}

input, select {
    flex: 1;
    min-width: 0;
    height: 3.5rem;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    background-color: #f1f2f4;
    color: #121416;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
}

input::placeholder {
    color: #6a7681;
}

/* 按鈕 */
.convert-button {
    display: block;
    min-width: 84px;
    margin: 1rem auto;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background-color: #dce8f3;
    color: #121416;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

/* 結果區域 */
.results {
    max-width: 80%;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
}

.results h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #374151;
}

.result-item {
    display: grid;
    grid-template-columns: 20% 1fr auto;
    gap: 1.5rem;
    padding: 1.25rem;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.result-item .label {
    color: #6a7681;
    font-size: 0.875rem;
}

.result-item .value {
    color: #121416;
    font-size: 0.875rem;
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* 複製按鈕樣式 */
.copy-button {
    padding: 0.5rem 1rem;
    background-color: #dce8f3;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: #cee4f8;
    color: #1f2937;
}

/* Toast 提示樣式 */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: #059669;
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 反白效果 */
.highlight {
    background-color: #dbeafe;
    transition: background-color 0.2s ease;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .main {
        padding: 1.25rem 2rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .input-row {
        flex-direction: column;
    }
}

/* 時間戳記容器 */
.timestamp-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.timestamp-container input:hover,
.timestamp-container input:focus {
    background-color: #ffffff;
}

/* 自動更新切換按鈕 */
.auto-toggle {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auto-toggle.auto {
    background-color: #dcfce7;
    color: #166534;
}

.auto-toggle.manual {
    background-color: #fee2e2;
    color: #991b1b;
}

.auto-toggle.manual::before {
    content: "-";
}

/* 時區選擇器 */
.timezone-select {
    display: flex;
    align-items: center;
}

.timezone-dropdown {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dde1e3;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #6a7681;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.timezone-dropdown:hover {
    border-color: #b3b9bd;
}

.timezone-dropdown:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 更新頁尾樣式 */
.footer {
    flex-shrink: 0;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.footer-links {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0 0.5rem;
}

.footer-links a:hover {
    color: #333;
}

.footer-copyright {
    font-size: 0.9rem;
    color: #666;
} 