/* 首页特定样式 - 微软简约风格 */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
}

/* 模式选择卡片 */
.mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 登录按钮占满一行 */
.mode-card:first-child {
    width: 100%;
    justify-content: center;
    overflow: hidden;
}

.mode-card:first-child .mode-desc {
    animation: descFadeOut 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
}

@keyframes descFadeOut {
    0% {
        opacity: 1;
        max-width: 120px;
        margin-left: 0;
    }
    100% {
        opacity: 0;
        max-width: 0;
        margin-left: -12px;
    }
}

/* 注册分组框 */
.mode-card-group {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: groupExpand 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

@keyframes groupExpand {
    0% {
        background: #fff;
        border: 1px solid #e5e7eb;
        padding: 16px;
    }
    100% {
        background: transparent;
        border: 1px solid transparent;
        padding: 0;
    }
}

.mode-card-group-title {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    animation: titleFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
    opacity: 1;
    height: 20px;
    margin-bottom: 12px;
}

@keyframes titleFadeUp {
    0% {
        opacity: 1;
        transform: translateY(0);
        height: 20px;
        margin-bottom: 12px;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
        height: 0;
        margin-bottom: 0;
    }
}

.mode-card-group-items {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    animation: itemsExpand 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

@keyframes itemsExpand {
    0% {
        gap: 12px;
    }
    100% {
        gap: 12px;
    }
}

.mode-card-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 16px 12px;
    background: #f9fafb;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: itemTransform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

@keyframes itemTransform {
    0% {
        background: #f9fafb;
        border: 1px solid transparent;
        box-shadow: none;
    }
    100% {
        background: #fff;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    }
}

.mode-card-item:hover {
    border-color: #0078d4;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.mode-card-item:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.mode-card-item .mode-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
}

.mode-card-item .mode-title {
    font-size: 12px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    animation: titleHeightExpand 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

@keyframes titleHeightExpand {
    0% {
        height: 0;
        margin-top: 0;
    }
    100% {
        height: 18px;
        margin-top: 8px;
    }
}

.register-text {
    display: inline-block;
    opacity: 0;
    transform: scale(0.85) translateY(3px);
    animation: registerTextShow 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.4s forwards;
}

@keyframes registerTextShow {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(3px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mode-card:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
    transform: translateY(-1px);
}

.mode-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
}

.mode-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mode-desc {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* 微软风格表单 */
.ms-form {
    animation: msSlideIn 0.3s ease-out;
}

@keyframes msSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ms-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ms-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ms-back-btn:hover {
    background: #e5e7eb;
}

.ms-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.ms-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}

.ms-progress-bar {
    height: 100%;
    background: #0078d4;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.ms-step {
    animation: msStepIn 0.35s ease-out;
}

@keyframes msStepIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-step-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.ms-step-subtitle {
    font-size: 14px;
    color: #0078d4;
    margin-bottom: 24px;
}

.ms-step-hint {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
    min-height: 20px;
}

.hint-text-static {
    display: inline-block;
    opacity: 0;
    animation: hintFadeIn 1s ease-out 0.3s forwards;
}

@keyframes hintFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s;
    box-sizing: border-box;
}

.ms-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.ms-input::placeholder {
    color: #9ca3af;
}

.ms-btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #0078d4;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.ms-btn-primary:hover {
    background: #106ebe;
}

.ms-btn-primary:active {
    transform: scale(0.98);
}

.ms-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ms-btn-secondary {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.ms-btn-secondary:hover {
    color: #0078d4;
}

/* 成功页面 */
.ms-success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: msSuccessPop 0.4s ease-out;
}

@keyframes msSuccessPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ms-success-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 12px;
}

.logo {
    text-align: center;
    margin-bottom: 32px;
    transition: all 0.3s ease;
    opacity: 1;
    max-height: 200px;
    overflow: hidden;
}

.logo.logo-hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
}

/* 登录类型选择卡片 */
.login-type-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.login-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-type-card:hover {
    border-color: #0078d4;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.login-type-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.login-type-info {
    flex: 1;
}

.login-type-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.login-type-desc {
    font-size: 13px;
    color: #6b7280;
}

/* Device Key选项按钮 */
.device-key-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

/* 教程内容 */
.tutorial-content {
    margin: 24px 0;
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tutorial-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.tutorial-image:hover {
    transform: scale(1.01);
}

.tutorial-zoom-hint {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-top: -12px;
    margin-bottom: 16px;
}

.ms-success-message {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.ms-account-info {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
}

.ms-account-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.ms-account-info-row:last-child {
    border-bottom: none;
}

.ms-account-info-label {
    color: #6b7280;
}

.ms-account-info-value {
    color: #1f2937;
    font-weight: 500;
    font-family: monospace;
    word-break: break-all;
}

/* 用户信息卡片 - 微软简约风格 */
.user-info {
    display: none;
    animation: userInfoFadeIn 0.4s ease-out;
}

@keyframes userInfoFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用户信息头部 */
.user-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-header-text {
    flex: 1;
    min-width: 0;
}

.user-display-name {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.user-status-inline {
    font-size: 13px;
    color: #6b7280;
}

/* 状态卡片网格 */
.status-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.status-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.status-card:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.1);
    transform: translateY(-2px);
}

.status-card-clickable {
    cursor: pointer;
}

.status-card-clickable:hover {
    border-color: #0078d4;
    background: #f0f9ff;
}

.status-card-primary {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.status-card-primary:hover {
    border-color: #38bdf8;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.status-card-content {
    flex: 1;
    min-width: 0;
}

.status-card-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.status-card-value {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    word-break: break-word;
}

/* 信息区块 */
.info-section {
    margin-bottom: 20px;
}

.info-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.info-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px 16px;
    transition: all 0.2s ease;
}

.info-card:hover {
    border-color: #d1d5db;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 16px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.info-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

.info-value-mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    background: #f9fafb;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.server-info {
    background: #eff6ff;
    border-left: 3px solid #0078d4;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #1e40af;
}

.server-info strong {
    color: #1e3a8a;
    display: block;
    margin-bottom: 6px;
}

.server-info code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #0078d4;
}

.login-form {
    display: block;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

.image-preview-content {
    background: white;
    border-radius: 16px;
    max-width: min(960px, 94vw);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

.image-preview-header {
    margin-bottom: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.image-preview-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.image-preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.image-preview-subtitle {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.2;
}

.image-preview-body {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9fafb;
}

.image-preview-img {
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    object-fit: contain;
    cursor: zoom-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.modal-header h3 {
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* 模态框内的消息提示 */
.modal-content .message {
    margin-bottom: 20px;
}

/* 模态框内的操作按钮 */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn-action {
    flex: 1;
}

/* 用户操作按钮区域 */
.user-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 16px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    white-space: nowrap;
}

.btn-action:hover {
    background: #f9fafb;
    border-color: #0078d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* 充值按钮特殊样式 */
.btn-action-primary {
    background: #0078d4;
    border-color: #0078d4;
    color: white;
}

.btn-action-primary:hover {
    background: #106ebe;
    border-color: #106ebe;
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.3);
}

/* 退出登录按钮样式 */
.btn-action-logout {
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-action-logout:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* Device Key与卡密区别模态框样式 - 微软简约风格 */
.key-difference-content {
    padding: 0;
}

.error-notice {
    background: #eff6ff;
    border-left: 4px solid #0078d4;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 4px;
    animation: noticeFadeIn 0.4s ease-out;
}

@keyframes noticeFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.notice-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #1e3a8a;
}

.notice-text strong {
    font-weight: 600;
    color: #0078d4;
}

.format-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.format-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    animation: sectionFadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.format-section:first-child {
    animation-delay: 0.1s;
}

.format-section:last-child {
    animation-delay: 0.2s;
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.format-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.format-example {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
    overflow-x: auto;
    word-break: break-all;
}

.format-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* 移动端优化 */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .container {
        max-width: 100%;
    }
    
    /* 用户信息头部移动端优化 */
    .user-info-header {
        padding: 20px;
        border-radius: 12px;
    }
    
    .user-avatar {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .user-display-name {
        font-size: 18px;
    }
    
    .user-status-inline {
        font-size: 12px;
    }
    
    /* 状态卡片移动端优化 */
    .status-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .status-card {
        padding: 14px;
    }
    
    .status-card-label {
        font-size: 11px;
    }
    
    .status-card-value {
        font-size: 15px;
    }
    
    /* 信息卡片移动端优化 */
    .info-section-title {
        font-size: 12px;
    }
    
    .info-card {
        padding: 4px 12px;
    }
    
    .info-row {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .info-label {
        font-size: 12px;
    }
    
    .info-value {
        font-size: 13px;
        text-align: left;
        width: 100%;
    }
    
    .info-value-mono {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        padding: 24px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    /* 按钮移动端优化 */
    .user-actions {
        gap: 8px;
    }
    
    .btn-action {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    /* 步骤标题移动端优化 */
    .ms-step-title {
        font-size: 20px;
    }
}

