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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.container {
    max-width: 550px;
    margin: 40px auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header h1 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #7f8c8d;
    font-size: 16px;
}

.form-section {
    margin-bottom: 30px;
}

.register-form {
    display: flex;
    flex-direction: column;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 15px;
}

.required {
    color: #e74c3c;
    font-size: 16px;
    margin-left: 2px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #adb5bd;
    font-size: 15px;
}

input[type="text"]:focus::placeholder,
input[type="password"]:focus::placeholder {
    color: transparent;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #f8f9fa;
}

input.error {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
}

.primary-button {
    padding: 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.primary-button:hover:not(:disabled)::before {
    left: 100%;
}

.primary-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #1f6ea5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.primary-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.3);
}

.primary-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left-color: #28a745;
}

.result-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left-color: #dc3545;
}

.result-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-left-color: #17a2b8;
}

.hidden {
    display: none;
}

.form-tip {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.field-description {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.error-message {
    font-size: 13px;
    color: #e74c3c;
    margin-top: 5px;
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-section {
    background-color: rgba(248, 249, 250, 0.8);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid #6c757d;
    transition: all 0.3s ease;
}

.info-section:hover {
    background-color: rgba(248, 249, 250, 1);
    transform: translateX(5px);
}

.info-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-section ul {
    list-style-type: none;
    padding: 0;
}

.info-section li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #555;
    font-size: 14px;
}

.info-section li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 8px;
}

.success-content {
    text-align: left;
}

.success-content h4 {
    margin-bottom: 15px;
    color: #155724;
    font-size: 18px;
    text-align: center;
}

.success-content p {
    margin: 10px 0;
    font-size: 16px;
}

.success-content strong {
    color: #2c3e50;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.success-hint {
    font-style: italic;
    color: #6c757d;
    font-size: 14px !important;
    margin-top: 15px !important;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: #7f8c8d;
    font-size: 14px;
    background-color: #fff;
    border-top: 1px solid #eee;
}

/* 登录页面特定样式 */
.login-form {
    display: flex;
    flex-direction: column;
}

/* API信息面板 */
.api-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.api-info h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.api-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.api-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.api-label {
    font-weight: 500;
    min-width: 80px;
    margin-right: 15px;
}

.api-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
}

.api-key-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-key {
    flex: 1;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
    user-select: all;
}

.show-key-btn, .copy-key-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.show-key-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.show-key-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.copy-key-btn {
    background: rgba(40, 167, 69, 0.8);
    color: white;
}

.copy-key-btn:hover {
    background: rgba(40, 167, 69, 1);
}

/* API加载动画 */
.api-loading {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.api-loading .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.api-loading .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.api-loading p {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* 配额加载动画样式 */
.quota-loading {
    text-align: center;
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    margin: 10px 0;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-content .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #28a745;
    margin-bottom: 15px;
    margin-right: 0;
}

.loading-content p {
    color: #155724;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.quota-info {
    background-color: rgba(212, 237, 218, 0.8);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.quota-info:hover {
    background-color: rgba(212, 237, 218, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.2);
}

.quota-info h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.quota-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quota-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.quota-label {
    font-weight: 500;
    color: #155724;
    font-size: 14px;
}

.quota-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

/* 过期时间信息样式 */
.expiration-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    color: white;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
    transition: all 0.3s ease;
}

.expiration-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(240, 147, 251, 0.4);
}

.expiration-info h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.expiration-loading {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.expiration-loading .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.expiration-loading .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.expiration-loading p {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.expiration-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.expiration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border-left: 4px solid white;
}

.expiration-label {
    font-weight: 500;
    color: white;
    font-size: 16px;
}

.expiration-value {
    font-weight: 600;
    color: white;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
}

.expiration-notice {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 5px;
}

.expiration-notice p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

.navigation-section {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.nav-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 10px auto;
        padding: 20px;
        border-radius: 8px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .info-section {
        padding: 15px;
    }
    
    .success-content p {
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 16px;
        height: 16px;
        border-width: 2px;
        margin-right: 8px;
    }
    
    /* 配额加载动画移动端优化 */
    .quota-loading {
        padding: 30px 15px;
    }
    
    .loading-content .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
        margin-bottom: 12px;
    }
    
    .loading-content p {
        font-size: 14px;
    }
    
    /* 登录页面移动端优化 */
    .quota-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quota-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .quota-label {
        margin-bottom: 5px;
        font-size: 13px;
    }
    
    .quota-value {
        font-size: 16px;
        color: #28a745;
    }
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    background-color: #6a11cb;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.disclaimer-section, .terms-section {
    margin-bottom: 30px;
}

.disclaimer-section h3, .terms-section h3 {
    color: #6a11cb;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.disclaimer-content, .terms-content {
    line-height: 1.6;
}

.disclaimer-content h4, .terms-content h4 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.disclaimer-content p, .terms-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.disclaimer-content ul, .terms-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.disclaimer-content li, .terms-content li {
    margin-bottom: 8px;
}

.modal-footer {
    padding: 20px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.agree-btn, .disagree-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.agree-btn {
    background-color: #2575fc;
    color: white;
}

.agree-btn:hover {
    background-color: #1a5bc4;
}

.disagree-btn {
    background-color: #e0e0e0;
    color: #333;
}

.disagree-btn:hover {
    background-color: #d0d0d0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .disclaimer-section h3, .terms-section h3 {
        font-size: 1.2rem;
    }
    
    .disclaimer-content h4, .terms-content h4 {
        font-size: 1rem;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .agree-btn, .disagree-btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 15px;
    }
    
    input[type="text"],
    input[type="password"] {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .primary-button {
        padding: 12px;
        font-size: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}