/* KinCal H5 Mobile Control Page Styles */
/* Mobile-first, max-width 480px */

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

body {
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Auth pages (login/register) */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.auth-page .logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-page .logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-page .logo p {
    font-size: 14px;
    color: #999;
    margin-top: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS auto-zoom */
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #1a73e8;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-primary:disabled {
    background: #a0c4f1;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn-danger {
    background: #e8453c;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #1a73e8;
    border: 1px solid #1a73e8;
}

.btn-outline:hover {
    background: #eff6ff;
}

/* Messages */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #c53030;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Links */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
    font-size: 14px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e8e8e8;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Device cards */
.device-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-info {
    flex: 1;
}

.device-name {
    font-weight: 600;
    font-size: 16px;
}

.device-short-code {
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 18px;
    font-weight: 700;
    color: #1a73e8;
    cursor: pointer;
    user-select: all;
    padding: 4px 8px;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.device-short-code:active {
    background: #dbeafe;
}

/* Inline create form */
.inline-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.inline-form input {
    flex: 1;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.inline-form .btn {
    width: auto;
    padding: 10px 20px;
    white-space: nowrap;
}

/* Rename button */
.btn-rename {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.6;
}

.btn-rename:hover {
    opacity: 1;
    color: #1a73e8;
}

/* Phone bind */
.phone-input-group {
    display: flex;
    gap: 8px;
}

.phone-input-group input {
    flex: 1;
}

.code-input-group {
    display: flex;
    gap: 8px;
}

.code-input-group input {
    flex: 1;
}

.phone-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-bottom: 16px;
}

.phone-status .verified {
    color: #166534;
    font-weight: 600;
}

/* Plan */
.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.plan-free {
    background: #f0f0f0;
    color: #666;
}

.plan-pro {
    background: #fef3c7;
    color: #92400e;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list .check {
    color: #22c55e;
    margin-right: 8px;
}

.feature-list .cross {
    color: #d1d5db;
    margin-right: 8px;
}

/* Calendar connection */
.calendar-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.calendar-status .provider {
    font-weight: 600;
}

.calendar-status .status-connected {
    color: #22c55e;
    font-size: 14px;
}

/* Bottom navigation */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    max-width: 100%;
}

.nav-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: #999;
    text-decoration: none;
    padding: 4px 12px;
}

.nav-bar a.active {
    color: #1a73e8;
}

.nav-bar a svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* Page content spacing for nav bar */
.page-content {
    padding-bottom: 80px;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

/* Countdown button */
.btn-countdown {
    white-space: nowrap;
    min-width: 110px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .plan-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 408px; /* 手机上允许横向滚动 */
    font-size: 13px;
  }

  .plan-table th,
  .plan-table td {
    border: 1px solid #e5e7eb;
    padding: 6px 6px;
    vertical-align: top;
    text-align: left;
    background: #fff;
  }

  .plan-table thead th {
    background: #f9fafb;
    font-weight: 600;
  }

  .plan-table tbody tr:nth-child(2n) td {
    background: #fcfcfd;
  }

  /* Pricing cards */
  .pricing-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  .pricing-card {
    flex: 0 0 72%;
    min-width: 220px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 16px;
    border: 2px solid #e8e8e8;
    position: relative;
    scroll-snap-align: center;
  }

  .pricing-card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a1a1a;
  }

  .pricing-card-price {
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
    font-weight: 500;
  }

  .pricing-card-tag {
    position: absolute;
    top: -1px;
    right: 16px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 0 0 6px 6px;
    letter-spacing: 0.5px;
  }

  .pricing-card-badge {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 6px;
  }

  .pricing-card-badge-current {
    background: #f0f0f0;
    color: #666;
  }

  .pricing-card-badge-soon {
    background: #fef3c7;
    color: #92400e;
  }

  .pricing-card-free {
    border-color: #e8e8e8;
  }

  .pricing-card-pro {
    border-color: #f59e0b;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
  }

  .pricing-card-biz {
    border-color: #8b5cf6;
  }

  .pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
  }

  .pricing-features li {
    padding: 2px 0;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
  }

  .pricing-features li:last-child {
    border-bottom: none;
  }

  .pricing-features li.disabled {
    color: #bbb;
  }

  .pricing-features .check {
    color: #22c55e;
    margin-right: 6px;
    font-weight: 700;
  }

  .pricing-features .cross {
    color: #d1d5db;
    margin-right: 6px;
  }

  .pricing-features li strong {
    color: #1a73e8;
  }

  /* Pro column highlight in table */
  .plan-table-pro-col {
    background: #fffbeb !important;
  }

  .plan-table-center {
    text-align: center;
  }

  .plan-table-feature {
    min-width: 60px;
  }

  /* Current plan column highlight */
  .plan-table-current {
    position: relative;
  }

  .plan-table-current::after {
    content: "当前";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #1a73e8;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 0 0 4px 4px;
  }

/* Home page tabs */
.home-page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.home-logo {
  text-align: center;
  padding-top: 24px;
  margin-bottom: 8px;
}

.home-logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.home-logo p {
  font-size: 14px;
  color: #999;
  margin-top: 4px;
}

.home-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.tab-panel {
  display: none;
  padding-top: 20px;
  padding-bottom: 32px;
}

.tab-panel.active {
  display: block;
}

/* Intro section */
.intro-hero {
  text-align: center;
  margin-bottom: 24px;
}

.intro-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.4;
}

.intro-hero p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
}

.intro-features {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.intro-features li {
  padding: 10px 0;
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  border-bottom: 1px solid #f0f0f0;
}

.intro-features li:last-child {
  border-bottom: none;
}

.intro-features li::before {
  content: "•";
  color: #1a73e8;
  font-weight: 700;
  margin-right: 8px;
}

.intro-carousel {
  position: relative;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  max-width: 280px;
}

.carousel-track {
  position: relative;
  width: 100%;
  padding-bottom: 133%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-dots {
  text-align: center;
  padding: 8px 0 10px;
}

.carousel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  margin: 0 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.carousel-dot.active {
  background: #1a73e8;
}

.intro-cta {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #999;
}

/* Guide steps */
.guide-steps {
  margin: 20px 0;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.guide-step:last-child {
  border-bottom: none;
}

.guide-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-content {
  flex: 1;
}

.guide-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.guide-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* Textarea */
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}

.form-group textarea:focus {
  border-color: #1a73e8;
}

/* Feedback status badge */
.badge-pending {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}

.badge-processed {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
}
