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

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* 一级标签页 */
.tabs {
    display: flex;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    padding: 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
}

.tabs::-webkit-scrollbar {
    height: 6px;
}

.tabs::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 15px 24px;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

/* 二级标签页 */
.tabs-level2 {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 10px;
    margin-bottom: 20px;
}

.tab-btn-level2 {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border-radius: 6px 6px 0 0;
}

.tab-btn-level2:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.tab-btn-level2.active {
    color: var(--primary-color);
    background: var(--bg-color);
}

.tab-btn-level2.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 二级内容区 */
.subtab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.subtab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-section {
    margin-bottom: 40px;
    padding: 25px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tool-section.compact {
    margin-bottom: 0;
    padding: 20px;
}

.tool-section:last-child {
    margin-bottom: 0;
}

.tool-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.compact {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.select-input {
    background: white;
    cursor: pointer;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group input {
    flex: 1;
    min-width: 0; /* 防止输入框溢出 */
}

.input-group button {
    flex: 0 0 auto;
    white-space: nowrap; /* 防止按钮文字换行 */
}

.input-button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-button-group input {
    flex: 1;
}

.input-button-group button {
    flex: 0 0 auto;
    margin-top: 0;
}

/* 时间转换专用样式 */
.time-display-group {
    background: white;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.time-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 280px;
}

.time-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.time-value {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
}

.btn-copy-mini {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-copy-mini:hover {
    background: #059669;
    transform: scale(1.05);
}

.convert-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.convert-row .arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    flex: 0 0 auto;
}

.input-half {
    flex: 1;
    min-width: 200px;
}

.result-box-inline {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    margin-right: 10px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-copy {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-copy:hover {
    background: #059669;
    transform: scale(1.05);
}

.result-box {
    background: white;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.result-box span {
    flex: 1;
}

.hash-buttons,
.crypto-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.info-box {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 15px;
    color: #92400e;
}

.info-box ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.info-box li {
    margin: 4px 0;
}

hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 30px 0;
}

hr.compact {
    margin: 20px 0;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        padding: 0 10px;
    }

    .tab-btn {
        padding: 15px 10px;
        font-size: 0.9rem;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .tool-section {
        padding: 20px 15px;
    }

    .hash-buttons,
    .crypto-buttons {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        margin-right: 0;
    }

    .result-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-copy {
        margin-left: 0;
        width: 100%;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.copying {
    animation: pulse 0.5s;
}
