/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 工具容器 */
.tool-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .tool-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 模块样式 */
.module {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.module:hover {
    transform: translateY(-5px);
}

.module h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 10px;
}

.generate-module h2 {
    border-bottom-color: #48bb78;
}

.verify-module h2 {
    border-bottom-color: #4299e1;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

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

/* 密码切换按钮 */
.form-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 35px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

/* 时间选择器样式 */
.time-selector {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    background: #f7fafc;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.radio-group label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.time-options select,
.time-options input[type="datetime-local"] {
    margin-top: 10px;
}

/* 复选框样式 */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.4;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3182ce, #2c5aa0);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.4);
}

/* 结果区域样式 */
.result-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e2e8f0;
}

.result-section h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.result-box {
    margin-bottom: 15px;
}

.result-box textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    min-height: 140px;
    padding: 20px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.copy-btn {
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: #3182ce;
}

/* 签名信息样式 */
.signature-info {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.signature-info p {
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature-info strong {
    min-width: 120px;
}

.signature-info .warning {
    color: #d69e2e;
    font-weight: 600;
}

.signature-info .expired {
    color: #e53e3e;
    font-weight: 600;
}

.signature-info .valid {
    color: #38a169;
    font-weight: 600;
}

/* 校验结果样式 */
.verify-results {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.verify-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.verify-item:last-child {
    border-bottom: none;
}

.verify-label {
    font-weight: 600;
    color: #4a5568;
}

.verify-result {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
}

.verify-result.success {
    background: #c6f6d5;
    color: #22543d;
}

.verify-result.error {
    background: #fed7d7;
    color: #742a2a;
}

.verify-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
}

.verify-details h4 {
    color: #4a5568;
    margin-bottom: 10px;
}

.verify-details pre {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 15px;
    font-size: 12px;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    box-sizing: border-box;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #48bb78;
}

.notification.error {
    background: #f56565;
}

.notification.warning {
    background: #ed8936;
}

.notification.info {
    background: #4299e1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 页脚样式 */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
    padding: 20px;
}

footer p {
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .module {
        padding: 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}
