/* 现代电话界面样式 */
:root {
    /* 电话主色调 */
    --phone-bg: #1a1a1a;
    --phone-screen: #000000;
    --phone-frame: #2d2d2d;
    --phone-button: #3a3a3a;
    --phone-button-hover: #4a4a4a;
    --phone-text: #ffffff;
    --phone-text-secondary: #888888;
    --phone-accent: #007AFF;
    --phone-success: #34C759;
    --phone-danger: #FF3B30;
    --phone-warning: #FF9500;
    
    /* 状态颜色 */
    --status-connected: #34C759;
    --status-connecting: #FF9500;
    --status-disconnected: #FF3B30;
    
    /* 阴影和效果 */
    --phone-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --button-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --screen-glow: 0 0 20px rgba(0, 122, 255, 0.3);
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    overflow: hidden;
}

/* 电话容器 */
.phone-container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    max-height: 800px;
    background: var(--phone-bg);
    border-radius: 30px;
    box-shadow: var(--phone-shadow);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 移动端提示 */
.mobile-notice {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 149, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
}

/* 语言切换按钮 */
.language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.lang-btn {
    background: rgba(0, 122, 255, 0.9);
    border: none;
    border-radius: 20px;
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 40px;
}

.lang-btn:hover {
    background: rgba(0, 122, 255, 1);
    transform: translateY(-1px);
}

.lang-btn:active {
    transform: scale(0.95);
}

/* 登录界面 */
.phone-login {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 30px;
    text-align: center;
}

.phone-header {
    margin-bottom: 40px;
}

.logo img {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    border-radius: 20px;
    margin-bottom: 20px;
    object-fit: contain;
}

.phone-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--phone-text);
    margin-bottom: 8px;
}

.phone-subtitle {
    font-size: 16px;
    color: var(--phone-text-secondary);
    margin-bottom: 0;
}

.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 24px;
}

.phone-input {
    width: 100%;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: var(--phone-text);
    font-size: 18px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.phone-input:focus {
    outline: none;
    border-color: var(--phone-accent);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}

.phone-input::placeholder {
    color: var(--phone-text-secondary);
}

.connect-btn {
    width: 100%;
    height: 50px;
    background: var(--phone-accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.connect-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: var(--button-shadow);
}

.connect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 电话主界面 */
.phone-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 电话屏幕 */
.phone-screen {
    background: var(--phone-screen);
    padding: 20px;
    border-radius: 20px 20px 0 0;
    margin: 15px 15px 0 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 20px rgba(0, 122, 255, 0.1);
    position: relative;
}



.call-display {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 8px;
    animation: pulse 2s infinite;
}

.status-connected {
    background: var(--status-connected);
}

.status-connecting {
    background: var(--status-connecting);
}

.status-disconnected {
    background: var(--status-disconnected);
}

.status-text {
    color: var(--phone-text);
    font-size: 16px;
    font-weight: 500;
}

.number-display {
    margin-bottom: 20px;
}

.number-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--phone-text);
    font-size: 32px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 2px;
}

.number-input:focus {
    outline: none;
}

.number-input::placeholder {
    color: var(--phone-text-secondary);
    font-size: 18px;
}

/* 快捷联系人 */
.quick-contacts {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-contact {
    background: var(--phone-button);
    border: none;
    border-radius: 12px;
    padding: 8px;
    color: var(--phone-text);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    min-width: 60px;
}

.quick-contact:hover {
    background: var(--phone-button-hover);
    transform: translateY(-1px);
}

.contact-avatar {
    font-size: 20px;
    margin-bottom: 4px;
}

/* 电话键盘 */
.phone-keypad {
    padding: 15px 20px;
    background: var(--phone-frame);
}

.keypad-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.key-btn {
    width: 60px;
    height: 60px;
    background: var(--phone-button);
    border: none;
    border-radius: 50%;
    color: var(--phone-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--button-shadow);
    position: relative;
    overflow: hidden;
}

.key-btn:hover {
    background: var(--phone-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.key-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.key-number {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.key-letters {
    font-size: 8px;
    color: var(--phone-text-secondary);
    margin-top: 1px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.key-btn.special .key-number {
    font-size: 22px;
    font-weight: 300;
}

/* 通话控制按钮 */
.call-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 30px 40px 40px;
    background: var(--phone-frame);
    gap: 20px;
}

.control-btn {
    width: 140px;
    height: 60px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--button-shadow);
    position: relative;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.call-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 2px solid #4CAF50;
}

.call-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

.call-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.hangup-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: 2px solid #f44336;
}

.hangup-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.5);
}

.hangup-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--button-shadow);
    background: #666 !important;
    border-color: #666 !important;
}

.btn-icon {
    font-size: 18px;
    color: white;
    font-weight: 700;
}

/* 系统信息 */
.system-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    justify-content: space-between;
    color: var(--phone-text);
    font-size: 12px;
    margin-bottom: 4px;
}

.info-item:last-child {
    margin-bottom: 0;
}

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

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        overflow: auto;
    }
    
    .phone-container {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }
    
    .language-switch {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 35px;
    }
    
    .phone-screen {
        margin: 10px 10px 0 10px;
        border-radius: 15px 15px 0 0;
    }
    
    .key-btn {
        width: 65px;
        height: 65px;
    }
    
    .control-btn {
        width: 120px;
        height: 50px;
        font-size: 16px;
    }
    
    .quick-contact {
        min-width: 50px;
        padding: 6px;
        font-size: 9px;
    }
    
    .contact-avatar {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    .key-btn {
        width: 60px;
        height: 60px;
    }
    
    .key-number {
        font-size: 20px;
    }
    
    .key-letters {
        font-size: 9px;
    }
    
    .control-btn {
        width: 100px;
        height: 45px;
        font-size: 14px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .phone-container {
        max-height: 100vh;
        flex-direction: row;
    }
    
    .phone-screen {
        flex: 1;
        margin: 10px 0 10px 10px;
        border-radius: 15px 0 0 15px;
    }
    
    .phone-keypad {
        width: 280px;
        padding: 15px;
    }
    
    .call-controls {
        padding: 15px 20px;
    }
    
    .keypad-row {
        margin-bottom: 10px;
    }
    
    .key-btn {
        width: 55px;
        height: 55px;
    }
    
    .quick-contacts {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .quick-contact {
        min-width: 45px;
        font-size: 8px;
    }
}

/* 深色模式增强 */
@media (prefers-color-scheme: dark) {
    :root {
        --phone-bg: #000000;
        --phone-screen: #111111;
        --phone-frame: #1c1c1e;
        --phone-button: #2c2c2e;
        --phone-button-hover: #3a3a3c;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --phone-text: #ffffff;
        --phone-text-secondary: #cccccc;
        --phone-button: #444444;
        --phone-button-hover: #555555;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 兼容性样式 - 保持原有功能 */
#ua {
    display: none;
}

.started #login-card {
    display: none;
}

.started #call-interface {
    display: flex;
}