/* 基础重置与变量 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #333333;
    --text-muted: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fce7f3;
    overflow: hidden;
    position: relative;
    color: var(--text-main);
}

/* 动态背景图形与动画 */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 15s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.4);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: rgba(236, 72, 153, 0.4);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: rgba(56, 189, 248, 0.4);
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-50px) scale(1.1); }
}

/* 毛玻璃卡片 UI/UX 设计 */
.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    z-index: 10;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeIn 1s ease-out forwards;
}

.glass-card:hover {
    transform: translateY(-5px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 文本排版 */
.header h2 {
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* 表单 UI 设计 */
.form-area {
    text-align: left;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.input-group input:focus,
.input-group select:focus {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

/* 按钮交互设计 */
.action-area {
    margin-bottom: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    padding: 14px 40px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 56px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -2px rgba(99, 102, 241, 0.4);
}

.btn-primary.disabled {
    pointer-events: none;
    opacity: 0.8;
}

/* 加载动画 */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner { display: block; }

/* 结果展示区动画 */
.result-area {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid rgba(255,255,255,0.8);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.9);
    opacity: 0;
}

.result-area.active {
    transform: scale(1);
    opacity: 1;
}

.hidden {
    display: none !important;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.id-display {
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 4px;
    margin-bottom: 1rem;
    font-family: monospace;
    text-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* 复制按钮 */
.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 底部 */
footer {
    position: absolute;
    bottom: 20px;
    font-size: 0.8rem;
    color: rgba(0,0,0,0.4);
    z-index: 10;
}

/* ɹҳеUI */
.success-icon {
    width: 64px;
    height: 64px;
    color: #10b981;
    margin: 0 auto 1rem;
}
.success-title {
    color: #10b981;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.success-greeting {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}
.success-id-box {
    background: rgba(255, 255, 255, 0.6);
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.success-id-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.success-actions button {
    flex: 1;
}


/* Զ˵ʽ */
.custom-select-wrapper { position: relative; user-select: none; width: 100%; text-align: left; }
.select-box { width: 100%; padding: 14px 16px; border: 2px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, 0.6); font-size: 1rem; color: var(--text-main); transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.select-box:hover, .custom-select-wrapper.open .select-box { border-color: rgba(99, 102, 241, 0.4); background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
.dropdown-icon { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-select-wrapper.open .dropdown-icon { transform: rotate(180deg); }
.options-container { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 100; overflow: hidden; transform-origin: top center; opacity: 0; visibility: hidden; transform: scaleY(0.9); transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-select-wrapper.open .options-container { opacity: 1; visibility: visible; transform: scaleY(1); }
.option-item { padding: 12px 16px; cursor: pointer; transition: background 0.2s, color 0.2s; color: var(--text-main); font-size: 0.95rem; }
.option-item:hover { background: rgba(99, 102, 241, 0.08); color: var(--primary-color); }
.option-item.select-active { background: rgba(99, 102, 241, 0.15); font-weight: 600; color: var(--primary-color); }


/*  */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.7); }


/* Э */
.agreement-area { margin-bottom: 1.5rem; text-align: left; padding: 0 4px; }
.checkbox-container { display: flex; align-items: center; cursor: pointer; font-size: 0.85rem; user-select: none; color: var(--text-main); transition: color 0.3s; }
.checkbox-container input { margin-right: 8px; width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary-color); }
.agreement-text a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.agreement-text a:hover { color: var(--primary-hover); text-decoration: underline; }
/* δѡʱĴʾ */
.checkbox-container.error { color: #ef4444; }
.checkbox-container.error a { color: #ef4444; }
/* 򵥵𶯶 */
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } }
.shake { animation: shake 0.4s ease-in-out; }


/* ģ̬Э鵯 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-card { width: 90%; max-width: 480px; padding: 2rem; transform: scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column; max-height: 80vh; background: var(--glass-bg); text-align: left; }
.modal-overlay.active .modal-card { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 1rem; }
.modal-header h3 { font-size: 1.2rem; color: var(--text-main); margin: 0; font-weight: 600; }
.close-btn { font-size: 1.8rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; line-height: 1; user-select: none; }
.close-btn:hover { color: #ef4444; }
.modal-body { overflow-y: auto; text-align: left; font-size: 0.9rem; line-height: 1.6; color: var(--text-main); margin-bottom: 1.5rem; padding-right: 15px; flex-grow: 1; }
.modal-body h4 { font-size: 1rem; margin-top: 1.2rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 0.8rem; color: #475569; }
.modal-footer { text-align: center; border-top: 1px solid rgba(0,0,0,0.1); padding-top: 1.5rem; }


/* Ϣʽ */
footer { width: 100%; text-align: center; }
.beian-info { margin-top: 4px; font-size: 0.75rem; }
.beian-info a { color: rgba(0,0,0,0.4); text-decoration: none; transition: color 0.2s; }
.beian-info a:hover { color: var(--primary-color); text-decoration: underline; }
